const keywords, or without a keyword at all ("bare" declaration). The method used determines the resulting scope of the variable, or reassignability in the case of
varkeyword creates a function-scope variable.
letkeyword creates a block-scope variable.
constkeyword creates a block-scope variable that cannot be reassigned.
var a = 'foo'; // Function-scope let b = 'foo'; // Block-scope const c = 'foo'; // Block-scope & immutable reference
Keep in mind that you can't declare constants without initializing them at the same time.
const foo; // "Uncaught SyntaxError: Missing initializer in const declaration"
(An example of keyword-less variable declaration is not included above for technical reasons. Continue reading to see an example.)