在javascript中,根据规定,关键字是保留的,不能用作变量名或函数名。
break | delete | function | return | type |
---|---|---|---|---|
case | do | if | switch | var |
catch | else | in | this | void |
continue | finally | instance of | throw | while |
default | for | new | try | with |
保留字在某种意义上是为将来的关键字而保留的单词。因此保留字不能被用作变量名或函数名。
abstract | debugger | final | int | private | super |
---|---|---|---|---|---|
boolean | double | float | interface | protected | synchronize |
byte | enum | goto | long | public | throws |
char | export | implements | native | short | transient |
class | extends | import | package | static | volatile,const |