JavaScript: Identifiers

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.
Wed, 09/15/2021 - 07:53

Authored by

Ashwin is working with iVagus as a Technical Lead. He has experience in various technologies like Cypress, JavaScript, TypeScript, Rest Assured, Selenium, Cucumber, and Java.
Tags