以下这些是ECMAScript规范已经规定的关键字,不能用作变量、函数名、过程、和对象名:
- break
- case
- catch
- continue
- default
- delete
- do
- else
- finally
- for
- function
- if
- in
- instanceof
- new
- return
- switch
- this
- throw
- try
- typeof
- var
- void
- while
- with
以下是ECMAScript规定的保留字:
- abstract
- boolean
- byte
- char
- class
- const
- debugger
- double
- enum
- export
- extends
- final
- float
- goto
- implements
- import
- int
- interface
- long
- native
- package
- private
- protected
- public
- short
- static
- super
- synchronized
- throws
- transient
- volatile
请注意,虽然ECMA-262还没有正式规定,但是在Mozilla中const,export和import已经被作为保留字对待。