JavaScript Identifiers

  • In JavaScript, the first character must be a letter, an underscore (_), or a dollar sign ($).
  • Numbers are not allowed as the first character.
  • Subsequent characters may be letters, digits, underscores, or dollar signs.
  • All JavaScript identifiers are case sensitive
  • The variables lastName and lastname, are two different variables.


Historically, programmers have used three ways of joining multiple words into one variable name:
Hyphens:
first-name, last-name, master-card, inter-city.
Underscore:
first_name, last_name, master_card, inter_city.
Camel Case:
FirstName, LastName, MasterCard, InterCity.

Comments

Popular posts from this blog

Bootstrap Breakpoints