3 ms·
My inner pedant really hates this first sentence: > There are three ways to create variables in a JavaScript application: using var, using let, or using const.
by Octoth0rpe 7y ago
My inner pedant really hates this first sentence:
> There are three ways to create variables in a JavaScript application: using var, using let, or using const.
No. There are two ways to create variables (let, var), and _one_ way to create a constant (const).
- anamexis 7y agoYour inner pedant isn't being pedantic enough, then, because the ES spec defines them all as variables. > 13.3.1 Let and Const Declarations > > NOTE let and const declarations define variables that are scoped to the running execution context’s LexicalEnvironment. http://www.ecma-international.org/ecma-262/6.0/#sec-declarations-and-the-variable-statement http://www.ecma-international.org/ecma-262/6.0/#sec-declarat...
- winrid 7y agoThey're not really constant though, if you wanna be really pedantic. You can modify a const object for example.