Identifier and Variable Names

This article describes best practices when using identifiers. Identifiers are "names" that identify variables, constants, properties, and other elements in a JavaScript program. For example, when creating a variable in a program to store your age, you might give it the identifier "age".

Here are some things to remember when using identifiers:

  • JavaScript is case-sensitive, and you must use consistent spelling;
  • identifiers cannot start with a digit; 
  • identifiers cannot have spaces in the name; and
  • use meaningful names.

Overview

Within programming a variety of items are given descriptive names to make the code more meaningful to us as humans. These names are called "Identifier Names". Constants, variables, type definitions, functions, etc. when declared or defined are identified by a name. These names follow a set of rules that are imposed by:

  1. the language's technical limitations
  2. good programming practices
  3. common industry standards for the language

Source: Kenneth Leroy Busbee and Dave Braunschweig, https://press.rebus.community/programmingfundamentals/chapter/identifier-names/
Creative Commons License This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 License.