Learn JavaScript
❯ getting_started.keywords_identifiers

Keywords and Identifiers in JavaScript

$concept

Keywords are reserved words — let, const, function, class, if, return, import, and about forty others — permanently owned by the language and never usable as names. A few (like await, yield, enum) are reserved for future or strict-mode use. Identifiers are the names you invent: they must start with a letter, underscore, or dollar sign, followed by letters, digits, underscores, or dollar signs.

JavaScript is case-sensitive (total vs Total differ), and convention is strong: camelCase for variables and functions, PascalCase for classes, SCREAMING_SNAKE_CASE for constants — enforced by linters, not the compiler.

$how it works
1

What counts as a keyword

Fixed reserved words (let, new, typeof, delete, ...) that always mean the same thing and can never name a variable.

2

What counts as an identifier

Any invented name starting with a letter, _, or $, continuing with letters, digits, _, $ — $ is legal (jQuery's fame) though uncommon in new code.

3

Case sensitivity

count, Count, and COUNT are three different bindings — capitalization is never ignored.

4

Convention over enforcement

camelCase variables, PascalCase classes, UPPER constants — universal style guides the compiler never checks.

$example
let userCount = 42;
let UserCount = 7;
const MAX_USERS = 100;
console.log(userCount, UserCount, MAX_USERS);
Output
42 7 100
1let and const are keywords — let let = 5 would fail to parse.
2userCount and UserCount differ by one capital, so they hold independent values.
3console.log prints multiple arguments space-separated: 42 7 100.
$use cases
Spotting typo'd identifiers via is not defined ReferenceErrors
Understanding why class or let can't be variable names
Following camelCase/PascalCase conventions in every codebase
Using $ legally (though rarely) in generated or legacy identifiers

Recommended resourcesAffiliate links · may earn us a commission

Recommended for learners

Structured coding coursesVideo courses that pair well with visual practice — pick one language and go deep.Browse courses Pro code editor & AI assistantWrite, debug and explain code faster while you practice the patterns here.Try it free Classic DSA interview booksThe reference books interviewers themselves learned from — great next to the visualizers.See the books

Practice what you learned

Re-implement each visualized algorithm in JavaScript yourself — building beats watching.