2011-04-26 66 views
0

JavaScript中有很多保留字,但實際上在該語言中使用了多少個保留字?實際使用什麼保留字?

 const for private typeof continue 
    catch final new transient function 
    abstract else instanceof switch 
       synchronized 
        boolean 
        enum 
        int 
        break 
        var 
        export 
        interface   debugger goto public 
        this   void 
        byte   default 
        protected   if 
        extends   return 
        long   volatile 
        throw   delete implements short 
continue   case        while 
    native   false        import 
    class   throws        do 
    char package float try        static 
    finally null true const   double in super with 

對於沒有以前所使用的那些,已經JavaScript的較新版本(比如1.5+)冤大頭(或計劃利用)的任何這些?

+0

*所有這些*使用。你的意思是他們的用法有多普遍? – 2011-04-26 01:09:34

+0

@RobertHarvey:或許,但請記住,我當然不是指內部,但我可以放心地說,我從來沒有見過使用'volatile'或'transient'。 – Shaz 2011-04-26 01:12:41

+2

發揮你的文字佈局^^^ – jonsca 2011-04-26 01:40:51

回答

2

結賬https://developer.mozilla.org/en/JavaScript/Reference/Reserved_Words

另外,我沒有看到你的一些話對http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf

看211頁,沒有volatile,例如:

-- Keyword : 
break 
do 
instanceof 
typeof 
case 
else 
new 
var 
catch 
finally 
return 
void 
continue 
for 
switch 
while 
debugger 
function 
this 
with 
default 
if 
throw 
delete 
in 
try 

-- FutureReservedWord : 
class 
enum 
extends 
super 
const 
export 
import 

-- Strict Mode : 
implements 
let 
private 
public 
interface 
package 
protected 
static 
yield 
+0

編輯我的回答,你的問題在某些方面可能不正確。 – 2011-04-26 02:23:57