關(guān)鍵字有:break、do、instanceof、typeof、case、else、new、var、catch、finally、return、void、continue、for、switch、while、if、try、this、with等。
本教程操作環(huán)境:windows7系統(tǒng)、javascript1.8.5版、Dell G3電腦。
JavaScript中關(guān)鍵字和保留字
不能把關(guān)鍵字、保留字、true、false和null用作標(biāo)識符。
JavaScript中的關(guān)鍵字可用于表示控制語句的開始或結(jié)束,或者用于執(zhí)行特定操作等。按照規(guī)則,關(guān)鍵字也是語言保留的,不能用作標(biāo)識符。
關(guān)鍵字
break | do | instanceof | typeof | case |
else | new | var | catch | finally |
return | void | continue | for | switch |
while | default | if | throw | delete |
in | try | function | this | with |
debugger | false | true | null |
保留字
class | enum | extends | super |
export | import | impelements | let |
public | yield | interface | package |
static | const |