Movatterモバイル変換


[0]ホーム

URL:


  1. Glossary
  2. Camel case

Camel case

Camel case is a way of writing phrases without spaces, where the first letter of each word is capitalized, except for the first letter of the entire compound word, which may be either upper or lower case. The name comes from the similarity of the capital letters to the humps of a camel's back. It's often stylized as "camelCase" to remind the reader of its appearance.

Camel casing is often used as a variable naming convention. The following variables are in camel case:console,encodeURIComponent,ArrayBuffer, andHTMLElement.

Note that if the phrase contains acronyms (such asURI andHTML), camel casing practices vary. Some prefer to keep all of them capitalized, such asencodeURIComponent above. This may sometimes lead to ambiguity with multiple consecutive acronyms, such asXMLHTTPRequest. Others prefer to only capitalize the first letter, asXmlHttpRequest. The actual global variable,XMLHttpRequest, uses a mix of both.

When the first letter of the entire phrase is upper case, it is calledupper camel case orPascal case. Otherwise, it is calledlower camel case.

Camel case is the most popular convention in JavaScript, Java, and various other languages.

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp