blob: e3cd47f9ab8593c32841f8ad0e8572eedca873c2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
---
title: Reserved Words
slug: conflicting/Web/JavaScript/Reference/Lexical_grammar
translation_of: Web/JavaScript/Reference/Lexical_grammar#Keywords
translation_of_original: Web/JavaScript/Reference/Reserved_Words
original_slug: Web/JavaScript/Reference/Reserved_words
---
<p> </p>
<p>以下这些是ECMAScript规范已经规定的关键字,不能用作变量、函数名、过程、和对象名:</p>
<ul>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/break">break</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/switch">case</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/try...catch">catch</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/continue">continue</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/switch">default</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Operators/Special_Operators/delete_Operator">delete</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/do...while">do</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/if...else">else</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/try...catch">finally</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/for">for</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/function">function</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/if...else">if</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/for...in">in</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Operators/Special_Operators/instanceof_Operator">instanceof</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Operators/Special_Operators/new_Operator">new</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/return">return</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/switch">switch</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Operators/Special_Operators/this_Operator">this</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/throw">throw</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/try...catch">try</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Operators/Special_Operators/typeof_Operator">typeof</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/var">var</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Operators/Special_Operators/void_Operator">void</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/while">while</a></li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/with">with</a></li>
</ul>
<p>以下是ECMAScript规定的保留字:</p>
<ul>
<li>abstract</li>
<li>boolean</li>
<li>byte</li>
<li>char</li>
<li>class</li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/const">const</a></li>
<li>debugger</li>
<li>double</li>
<li>enum</li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/export">export</a></li>
<li>extends</li>
<li>final</li>
<li>float</li>
<li>goto</li>
<li>implements</li>
<li><a href="cn/Core_JavaScript_1.5_Reference/Statements/import">import</a></li>
<li>int</li>
<li>interface</li>
<li>long</li>
<li>native</li>
<li>package</li>
<li>private</li>
<li>protected</li>
<li>public</li>
<li>short</li>
<li>static</li>
<li>super</li>
<li>synchronized</li>
<li>throws</li>
<li>transient</li>
<li>volatile</li>
</ul>
<p>请注意,虽然ECMA-262还没有正式规定,但是在Mozilla中const,export和import已经被作为保留字对待。</p>
<div class="noinclude"><a href="cn/Cn/Core_JavaScript_1.5_Reference/Reserved_Words">cn:Core JavaScript 1.5 Reference:Reserved Words</a>
<p> </p>
</div>
<p>{{ languages( { "en": "en/Core_JavaScript_1.5_Reference/Reserved_Words" } ) }}</p>
|