You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR: In the section titled "undefined and null", "keyword of" should be "reserved word in", and in the section titled "Notation of Keys", all three uses of "keyword" should be "reserved word"; all other uses of "keyword" are good (all in the phrase "new keyword"), because the importance of new in these contexts comes from its use in the language as a keyword, not from being reserved.
MDN is a bit confused on this matter (using the phrase "reserved keywords" and incorrectly stating that of is reserved, unless MDN accepts my revision), but the spec is a bit more clear: Such things as the future reserved word enum and the literals null, false, and true are reserved words, but not keywords, and they still cannot be used as variable names or (before ES5) unquoted property keys.
Furthermore, some words that occupy key positions in language constructs and can therefore be considered "key words" are not reserved at all, like as, of, get, and set; the first two are only key in ES6+, while the other two are used in ES5 shorthand methods.
It also appears, in Microsoft's well-known async-await proposal, that async will not be a reserved word despite occupying a key role in the new async function syntax (although await is in the latest draft spec as a future reserved word).
The text was updated successfully, but these errors were encountered:
TL;DR: In the section titled "
undefined
andnull
", "keyword of" should be "reserved word in", and in the section titled "Notation of Keys", all three uses of "keyword" should be "reserved word"; all other uses of "keyword" are good (all in the phrase "new
keyword"), because the importance ofnew
in these contexts comes from its use in the language as a keyword, not from being reserved.MDN is a bit confused on this matter (using the phrase "reserved keywords" and incorrectly stating that
of
is reserved, unless MDN accepts my revision), but the spec is a bit more clear: Such things as the future reserved wordenum
and the literalsnull
,false
, andtrue
are reserved words, but not keywords, and they still cannot be used as variable names or (before ES5) unquoted property keys.Furthermore, some words that occupy key positions in language constructs and can therefore be considered "key words" are not reserved at all, like
as
,of
,get
, andset
; the first two are only key in ES6+, while the other two are used in ES5 shorthand methods.It also appears, in Microsoft's well-known
async
-await
proposal, thatasync
will not be a reserved word despite occupying a key role in the new async function syntax (althoughawait
is in the latest draft spec as a future reserved word).The text was updated successfully, but these errors were encountered: