Skip to main content

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.
Tags
Submitted by arilio666 on September 15, 2021

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.

About

At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.