Jscript 有一些保留字不能在標(biāo)識(shí)符中使用。保留字對 Jscript 語言有特殊的含義,它們是語言語法的一部分。使用保留字在加載腳本的時(shí)候?qū)a(chǎn)生編譯錯(cuò)誤。
Jscript 還有一些留作將來使用的保留字。這些字不是現(xiàn)在的 Jscript 語言的一部分,然而它們是為將來的使用保留的。
break | delete | function | return | typeof |
case | do | if | switch | var |
catch | else | in | this | void |
continue | false | instanceof | throw | while |
debugger | finally | new | true | with |
default | for | null | try |
abstract | double | goto | native | static |
boolean | enum | implements | package | super |
byte | export | import | private | synchronized |
char | extends | int | protected | throws |
class | final | interface | public | transient |
const | float | long | short | volatile |
當(dāng)選擇標(biāo)識(shí)符時(shí)避免使用已經(jīng)在內(nèi)部 Jscript 對象或函數(shù)中使用的詞,如 String 或 parseInt。