keyword
🚧 施工中
Last updated
Was this helpful?
🚧 施工中
Last updated
Was this helpful?
⟩ ⟩ ⟩ keyword
A keyword is a token that matches (looks like an identifier), but also has a syntactic use. ( )
keywords can be divided into:
reserved word:
never allowed as identifier (except await
, yield
)
contextually allowed as identifier:
namely await
, yield
.
await
- reserved only inside async functions and modules.
contextually disallowed as identifier, in ::
let, static
, implements
, interface
, package
, private
, protected
, public
.
mostly allowed as identifier, but also appear as keywords within certain syntactic productions, at places where identifier is not allowed:
as
, async
, from
, get
, meta
, of
, set
, target
.
NaN
/Infinity
/ undefined is:
not keyword.
immutable & read-only of the global object.
JS doesn't throw any errors if you declare them in the global scope.
avoid using reserved word as identifiers (at least for variable/function)
in dot notation (.), it's OK to use reserved word as property name
⟩
ECMA ⟩ ⭐️
TeckTutorialHub ⟩ ⭐️