JavaScript: Identifiers

Profile picture for user arilio666

Just like any identifiers in any programming language javascript identifiers are just yet another name given to the variables, functions, etc. Be mindful before naming a variable and confusing yourself with the reserved keyword as a variable name.

Here are some of the eligible identifiers:

z, x, Num, num, score, _flagg, player9, $price, SCREEN_SIZE, setSize

Here are some of the ineligible identifiers:

9val, __flag, $$balance, continue

Just before we part our ways keep in mind these below set of rules before naming your variables:

  • We must not and never use reserved javascript keywords for our variable name as these are predefined in the programming language.
  • A variable must not start with a number but can be after succeeding characters of a string.
  • No special characters except underscore and dollar are allowed.
  • They are obviously case-sensitive.
  • As said all the succeeding characters can be alphabets, underscore, and digits.