Courses / JavaScript
31. Identifiers and Reserved Words
What valid identifiers are, naming rules, and reserved keywords in JavaScript.
JavaScript
Identifiers and Reserved Words
Names you give to variables, functions, and properties and which words you must not use because the language reserves them.
"I gave my variable a name and the program crashed — why?"
Identifiers are names that start with a letter, $, or _, and can include letters, digits, $, or _; reserved words are tokens the language uses (like for, class, or import) and cannot be used as identifiers. Modern JavaScript also reserves some words in strict mode and for future use.
"I gave my variable a name and the program crashed — why?"
Identifiers are names that start with a letter, $, or _, and can include letters, digits, $, or _; reserved words are tokens the language uses (like for, class, or import) and cannot be used as identifiers. Modern JavaScript also reserves some words in strict mode and for future use.