Camel case
Camel casing is often used as a variable naming convention. The following variables are in camel case:
console
,
encodeURIComponent
,
ArrayBuffer
, and
HTMLElement
.
Note that if the phrase contains acronyms (such as URI
and HTML
), camel casing practices vary. Some prefer to keep all of them capitalized, such as encodeURIComponent
above. This may sometimes lead to ambiguity with multiple consecutive acronyms, such as XMLHTTPRequest
. Others prefer to only capitalize the first letter, as XmlHttpRequest
. The actual global variable,
XMLHttpRequest
, uses a mix of both.
When the first letter of the entire phrase is upper case, it is called upper camel case or Pascal case . Otherwise, it is called lower camel case .
Camel case is the most popular convention in JavaScript, Java, and various other languages.