🔐reserved word
keywords that can't be used as identifier. (except for property names)
JS ⟩ grammar ⟩ keywords ⟩ reserved
(keyword) that cannot be used as an identifier, except for property name❗
// ⭐️ 38 reserved words
await break case catch class const continue debugger default delete do
else enum export extends false finally for function if import in
instanceof new null return super switch this throw true try typeof
var void while with yield
// ⭐️ `await`, `yield` are also contextual keywordsreplit:reserved words
features of reserved words
tools
str.isReservedWord - check if string is a reserved word.
avoid using reserved words as identifiers (at least for variable/function/label) ❗
await, yield are reserved word and contextual keywords at the same time.
dot notation (.) is used to access an object's property, it's property name can be a "reserved word".
Last updated
Was this helpful?