Students Empire

Learn Something New

Javascript Syntax


In Javascript everything is case-sensitive; variables, function names, and operators are all case-sensitive.

A variable named test is different from a variable named Test.

typeof can't be the name of a function, because it's a keyword; however, typeOf is a valid function name.


An identifier is the name of a variable, function, property, or function argument.

Identifiers may be one or more characters in the following format:

  • The first character must be a letter, an underscore (_), or a dollar sign ($).
  • All other characters may be letters, underscores, dollar signs, or numbers.
  • Letters in an identifier may include extended ASCII or Unicode letter characters, though this is not recommended.
  • Javascript identifiers use camel case, meaning that the first letter is lowercase and each additional word is offset by a capital letter, like this:
    • first
    • mywork
    • doSomethingImportant
  • Keywords, reserved words, true, false, and null cannot be used as identifiers.