What Are Identifiers in JavaScript?

Learn about JavaScript identifiers

In JavaScript, an identifier is the name that is given to variables, functions or properties to be able to refer to (or identify) them. In JavaScript, identifiers are case-sensitive and are governed by the following set of rules:

  • They can contain unicode letters (or escape sequences), $, _, or digits (0-9);
  • They cannot start with a digit.

For example, the following are all valid identifies for variables, functions and object properties:

foo
foo123
_foo_
$foo

As mentioned earlier, unicode characters or escape sequences are also valid identifiers. You can use these for variable, function or property names. For example, the following are all valid identifies for variables, functions and object properties:

\u0046\u006F\u006F
fǾǾ

Hope you found this post useful. It was published . Please show your love and support by sharing this post.