🗝️keyword
🚧 施工中
Last updated
Was this helpful?
🚧 施工中
Last updated
Was this helpful?
Was this helpful?
JS ⟩ grammar ⟩ token ⟩ keyword
A keyword is a token that matches IdentifierName (looks like an identifier), but also has a syntactic use. (📘ECMA )
// 54 keywords
as async await break case catch class const continue
debugger default delete do else enum export extends
false finally for from function get
if implements import in instanceof interface
let meta new null of package private protected public return
set static super switch target this throw true try typeof
var void while with yield
keywords can be divided into:
reserved word:
never allowed as identifier (except await
, yield
)
:
contextually allowed as :
namely await
, yield
.
NaN
/Infinity
/ is:
not .
avoid using as s (at least for /) ❗
in , it's OK to use
contextually disallowed as identifier, in strict mode code::
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
.
async
- can be used as a name or label without restriction.
immutable & read-only properties of the global object.
JS doesn't throw any errors if you declare them in the global scope.