aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/web/javascript/reference/index.html
blob: 25a68dc2213591355f5ba97a8296e0cad89f4c14 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
---
title: JavaScript 參考文件
slug: Web/JavaScript/Reference
tags:
  - JavaScript
  - NeedsTranslation
translation_of: Web/JavaScript/Reference
---
<div>{{JsSidebar}}</div>

<p>在 MDN 的 JavaScript 分區中,這一部分被作爲 Javascript 的資料庫。閱讀<a href="/zh-TW/docs/Web/JavaScript/Reference/About">關於該參考</a>以了解更多。</p>

<h2 id="全域物件">全域物件</h2>

<p>本章節記錄了所有 <a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects">JavaScript 標準內建物件</a> 以及其方法與屬性。</p>

<h3>數值屬性</h3>

<ul>
  <li>{{JSxRef("Infinity")}}</li>
  <li>{{JSxRef("NaN")}}</li>
  <li>{{JSxRef("undefined")}}</li>
  <li>{{JSxRef("globalThis")}}</li>
</ul>

<h3>函數屬性</h3>

<ul>
  <li>{{JSxRef("Global_Objects/eval", "eval()")}}</li>
  <li>{{JSxRef("Global_Objects/isFinite", "isFinite()")}}</li>
  <li>{{JSxRef("Global_Objects/isNaN", "isNaN()")}}</li>
  <li>{{JSxRef("Global_Objects/parseFloat", "parseFloat()")}}</li>
  <li>{{JSxRef("Global_Objects/parseInt", "parseInt()")}}</li>
  <li>{{JSxRef("Global_Objects/decodeURI", "decodeURI()")}}</li>
  <li>{{JSxRef("Global_Objects/decodeURIComponent", "decodeURIComponent()")}}</li>
  <li>{{JSxRef("Global_Objects/encodeURI", "encodeURI()")}}</li>
  <li>{{JSxRef("Global_Objects/encodeURIComponent", "encodeURIComponent()")}}</li>
</ul>

<h3>基礎物件</h3>

<ul>
  <li>{{JSxRef("Object")}}</li>
  <li>{{JSxRef("Function")}}</li>
  <li>{{JSxRef("Boolean")}}</li>
  <li>{{JSxRef("Symbol")}}</li>
</ul>

<h3>Error</h3>

<ul>
  <li>{{JSxRef("Error")}}</li>
  <li>{{JSxRef("AggregateError")}}</li>
  <li>{{JSxRef("EvalError")}}</li>
  <li>{{JSxRef("InternalError")}}</li>
  <li>{{JSxRef("RangeError")}}</li>
  <li>{{JSxRef("ReferenceError")}}</li>
  <li>{{JSxRef("SyntaxError")}}</li>
  <li>{{JSxRef("TypeError")}}</li>
  <li>{{JSxRef("URIError")}}</li>
</ul>

<h3>數字與日期</h3>

<ul>
  <li>{{JSxRef("Number")}}</li>
  <li>{{JSxRef("BigInt")}}</li>
  <li>{{JSxRef("Math")}}</li>
  <li>{{JSxRef("Date")}}</li>
</ul>

<h3>文字處理</h3>

<ul>
  <li>{{JSxRef("String")}}</li>
  <li>{{JSxRef("RegExp")}}</li>
</ul>

<h3>具索引的集合</h3>

<ul>
  <li>{{JSxRef("Array")}}</li>
  <li>{{JSxRef("Int8Array")}}</li>
  <li>{{JSxRef("Uint8Array")}}</li>
  <li>{{JSxRef("Uint8ClampedArray")}}</li>
  <li>{{JSxRef("Int16Array")}}</li>
  <li>{{JSxRef("Uint16Array")}}</li>
  <li>{{JSxRef("Int32Array")}}</li>
  <li>{{JSxRef("Uint32Array")}}</li>
  <li>{{JSxRef("Float32Array")}}</li>
  <li>{{JSxRef("Float64Array")}}</li>
  <li>{{JSxRef("BigInt64Array")}}</li>
  <li>{{JSxRef("BigUint64Array")}}</li>
</ul>

<h3>具鍵值的集合</h3>

<ul>
  <li>{{JSxRef("Map")}}</li>
  <li>{{JSxRef("Set")}}</li>
  <li>{{JSxRef("WeakMap")}}</li>
  <li>{{JSxRef("WeakSet")}}</li>
</ul>

<h3>結構化資料</h3>

<ul>
  <li>{{JSxRef("ArrayBuffer")}}</li>
  <li>{{JSxRef("SharedArrayBuffer")}}</li>
  <li>{{JSxRef("Atomics")}}</li>
  <li>{{JSxRef("DataView")}}</li>
  <li>{{JSxRef("JSON")}}</li>
</ul>

<h3>控制抽象化物件</h3>

<ul>
  <li>{{JSxRef("Promise")}}</li>
  <li>{{JSxRef("Generator")}}</li>
  <li>{{JSxRef("GeneratorFunction")}}</li>
  <li>{{JSxRef("AsyncFunction")}}</li>
</ul>

<h3>Reflection</h3>

<ul>
  <li>{{JSxRef("Reflect")}}</li>
  <li>{{JSxRef("Proxy")}}</li>
</ul>

<h3>國際化</h3>

<ul>
  <li>{{JSxRef("Intl")}}</li>
  <li>{{JSxRef("Global_Objects/Collator", "Intl.Collator")}}</li>
  <li>{{JSxRef("Global_Objects/DateTimeFormat", "Intl.DateTimeFormat")}}</li>
  <li>{{JSxRef("Global_Objects/ListFormat", "Intl.ListFormat")}}</li>
  <li>{{JSxRef("Global_Objects/NumberFormat", "Intl.NumberFormat")}}</li>
  <li>{{JSxRef("Global_Objects/PluralRules", "Intl.PluralRules")}}</li>
  <li>{{JSxRef("Global_Objects/RelativeTimeFormat", "Intl.RelativeTimeFormat")}}</li>
  <li>{{JSxRef("Global_Objects/Locale", "Intl.Locale")}}</li>
</ul>

<h3>WebAssembly</h3>

<ul>
  <li>{{JSxRef("WebAssembly")}}</li>
  <li>{{JSxRef("WebAssembly.Module")}}</li>
  <li>{{JSxRef("WebAssembly.Instance")}}</li>
  <li>{{JSxRef("WebAssembly.Memory")}}</li>
  <li>{{JSxRef("WebAssembly.Table")}}</li>
  <li>{{JSxRef("WebAssembly.CompileError")}}</li>
  <li>{{JSxRef("WebAssembly.LinkError")}}</li>
  <li>{{JSxRef("WebAssembly.RuntimeError")}}</li>
</ul>

<h2 id="敘述句">敘述句</h2>

<p>本章節記錄了所有 <a href="/zh-TW/docs/Web/JavaScript/Reference/Statements">JavaScript 敘述句與宣告</a></p>

<h3>流程控制</h3>

<ul>
  <li>{{jsxref("Statements/block", "Block")}}</li>
  <li>{{jsxref("Statements/break", "break")}}</li>
  <li>{{jsxref("Statements/continue", "continue")}}</li>
  <li>{{jsxref("Statements/Empty", "Empty")}}</li>
  <li>{{jsxref("Statements/if...else", "if...else")}}</li>
  <li>{{jsxref("Statements/switch", "switch")}}</li>
  <li>{{jsxref("Statements/throw", "throw")}}</li>
  <li>{{jsxref("Statements/try...catch", "try...catch")}}</li>
</ul>

<h3>宣告</h3>

<ul>
  <li>{{jsxref("Statements/var", "var")}}</li>
  <li>{{jsxref("Statements/let", "let")}}</li>
  <li>{{jsxref("Statements/const", "const")}}</li>
</ul>

<h3>函數與類別</h3>

<ul>
  <li>{{jsxref("Statements/function", "function")}}</li>
  <li>{{jsxref("Statements/function*", "function*")}}</li>
  <li>{{jsxref("Statements/async_function", "async function")}}</li>
  <li>{{jsxref("Statements/return", "return")}}</li>
  <li>{{jsxref("Statements/class", "class")}}</li>
</ul>

<h3>迭代</h3>

<ul>
  <li>{{jsxref("Statements/do...while", "do...while")}}</li>
  <li>{{jsxref("Statements/for", "for")}}</li>
  <li>{{jsxref("Statements/for_each...in", "for each...in")}}</li>
  <li>{{jsxref("Statements/for...in", "for...in")}}</li>
  <li>{{jsxref("Statements/for...of", "for...of")}}</li>
  <li>{{jsxref("Statements/for-await...of", "for await...of")}}</li>
  <li>{{jsxref("Statements/while", "while")}}</li>
</ul>

<h3>Other</h3>

<ul>
  <li>{{jsxref("Statements/debugger", "debugger")}}</li>
  <li>{{jsxref("Statements/import", "import")}}</li>
  <li>{{jsxref("Statements/label", "label")}}</li>
  <li>{{jsxref("Statements/with", "with")}}</li>
</ul>

<h2 id="表示法與運算子">表示法與運算子</h2>

<p>本章節記錄了所有 <a href="/zh-TW/docs/Web/JavaScript/Reference/Operators">JavaScript 表示法與運算子</a></p>

<h3>主要運算式</h3>

<ul>
  <li>{{JSxRef("Operators/this", "this")}}</li>
  <li>{{JSxRef("Operators/function", "function")}}</li>
  <li>{{JSxRef("Operators/class", "class")}}</li>
  <li>{{JSxRef("Operators/function*", "function*")}}</li>
  <li>{{JSxRef("Operators/yield", "yield")}}</li>
  <li>{{JSxRef("Operators/yield*", "yield*")}}</li>
  <li>{{JSxRef("Operators/async_function", "async function")}}</li>
  <li>{{JSxRef("Operators/await", "await")}}</li>
  <li>{{JSxRef("Global_Objects/Array", "[]")}}</li>
  <li>{{JSxRef("Operators/Object_initializer", "{}")}}</li>
  <li>{{JSxRef("Global_Objects/RegExp", "/ab+c/i")}}</li>
  <li>{{JSxRef("Operators/Grouping", "( )")}}</li>
  <li>{{JSxRef("null")}}</li>
</ul>

<h3>左手邊運算式</h3> 

<ul>
  <li>{{JSxRef("Operators/Property_accessors", "Property accessors", "", 1)}}</li>
  <li>{{JSxRef("Operators/new", "new")}}</li>
  <li>{{JSxRef("Operators/new%2Etarget", "new.target")}}</li>
  <li>{{JSxRef("Operators/super", "super")}}</li>
  <li>{{JSxRef("Operators/Spread_syntax", "...obj")}}</p></li>
</ul>

<h3>遞增與遞減</h3>

<ul>
  <li>{{JSxRef("Operators/Arithmetic_Operators", "A++", "#Increment")}}</li>
  <li>{{JSxRef("Operators/Arithmetic_Operators", "A--", "#Decrement")}}</li>
  <li>{{JSxRef("Operators/Arithmetic_Operators", "++A", "#Increment")}}</li>
  <li>{{JSxRef("Operators/Arithmetic_Operators", "--A", "#Decrement")}}</li>
</ul>

<h3>一元運算子</h3>

<ul>
  <li>{{JSxRef("Operators/delete", "delete")}}</li>
  <li>{{JSxRef("Operators/void", "void")}}</li>
  <li>{{JSxRef("Operators/typeof", "typeof")}}</li>
  <li>{{JSxRef("Operators/Arithmetic_Operators", "+", "#Unary_plus")}}</li>
  <li>{{JSxRef("Operators/Arithmetic_Operators", "-", "#Unary_negation")}}</li>
  <li>{{JSxRef("Operators/Bitwise_Operators", "~", "#Bitwise_NOT")}}</li>
  <li>{{JSxRef("Operators/Logical_Operators", "!", "#Logical_NOT")}}</li>
</ul>

<h3>算術運算子</h3>

<ul>
  <li>{{JSxRef("Operators/Arithmetic_Operators", "+", "#Addition")}}</li>
  <li>{{JSxRef("Operators/Arithmetic_Operators", "-", "#Subtraction")}}</li>
  <li>{{JSxRef("Operators/Arithmetic_Operators", "/", "#Division")}}</li>
  <li>{{JSxRef("Operators/Arithmetic_Operators", "*", "#Multiplication")}}</li>
  <li>{{JSxRef("Operators/Arithmetic_Operators", "%", "#Remainder")}}</li>
  <li>{{JSxRef("Operators/Arithmetic_Operators", "**", "#Exponentiation")}}</li>
</ul>

<h3>關係運算子</h3>

<ul>
  <li>{{JSxRef("Operators/in", "in")}}</li>
  <li>{{JSxRef("Operators/instanceof", "instanceof")}}</li>
  <li>{{JSxRef("Operators/Comparison_Operators", "&lt;", "#Less_than_operator")}}</li>
  <li>{{JSxRef("Operators/Comparison_Operators", "&gt;", "#Greater_than_operator")}}</li>
  <li>{{JSxRef("Operators/Comparison_Operators", "&lt;=", "#Less_than_or_equal_operator")}}</li>
  <li>{{JSxRef("Operators/Comparison_Operators", "&gt;=", "#Greater_than_or_equal_operator")}}</li>
</ul>

<h3>相等運算子</h3>

<ul>
  <li>{{JSxRef("Operators/Comparison_Operators", "==", "#Equality")}}</li>
  <li>{{JSxRef("Operators/Comparison_Operators", "!=", "#Inequality")}}</li>
  <li>{{JSxRef("Operators/Comparison_Operators", "===", "#Identity")}}</li>
  <li>{{JSxRef("Operators/Comparison_Operators", "!==", "#Nonidentity")}}</li>
</ul>

<h3>位元移位運算子</h3>

<ul>
  <li>{{JSxRef("Operators/Bitwise_Operators", "&lt;&lt;", "#Left_shift")}}</li>
  <li>{{JSxRef("Operators/Bitwise_Operators", "&gt;&gt;", "#Right_shift")}}</li>
  <li>{{JSxRef("Operators/Bitwise_Operators", "&gt;&gt;&gt;", "#Unsigned_right_shift")}}</li>
</ul>

<h3>二元位元運算子</h3>

<ul>
  <ul>
    <li>{{JSxRef("Operators/Bitwise_Operators", "&amp;", "#Bitwise_AND")}}</li>
    <li>{{JSxRef("Operators/Bitwise_Operators", "|", "#Bitwise_OR")}}</li>
    <li>{{JSxRef("Operators/Bitwise_Operators", "^", "#Bitwise_XOR")}}</li></li>
  </ul>
</ul>

<h3>二元邏輯運算子</h3>

<ul>
  <li>{{JSxRef("Operators/Logical_Operators", "&amp;&amp;", "#Logical_AND")}}</li>
  <li>{{JSxRef("Operators/Logical_Operators", "||", "#Logical_OR")}}</li>
</ul>

<h3>條件(三元)運算子</h3>

<ul>
  <li>{{JSxRef("Operators/Conditional_Operator", "(condition ? ifTrue : ifFalse)")}}</li>
</ul>

<h3>賦值運算子</h3>

<ul>
  <li>{{JSxRef("Operators/Assignment_Operators", "=", "#Assignment")}}</li>
  <li>{{JSxRef("Operators/Assignment_Operators", "*=", "#Multiplication_assignment")}}</li>
  <li>{{JSxRef("Operators/Assignment_Operators", "/=", "#Division_assignment")}}</li>
  <li>{{JSxRef("Operators/Assignment_Operators", "%=", "#Remainder_assignment")}}</li>
  <li>{{JSxRef("Operators/Assignment_Operators", "+=", "#Addition_assignment")}}</li>
  <li>{{JSxRef("Operators/Assignment_Operators", "-=", "#Subtraction_assignment")}}</li>
  <li>{{JSxRef("Operators/Assignment_Operators", "&lt;&lt;=", "#Left_shift_assignment")}}</li>
  <li>{{JSxRef("Operators/Assignment_Operators", "&gt;&gt;=", "#Right_shift_assignment")}}</li>
  <li>{{JSxRef("Operators/Assignment_Operators", "&gt;&gt;&gt;=", "#Unsigned_right_shift_assignment")}}</li>
  <li>{{JSxRef("Operators/Assignment_Operators", "&amp;=", "#Bitwise_AND_assignment")}}</li>
  <li>{{JSxRef("Operators/Assignment_Operators", "^=", "#Bitwise_XOR_assignment")}}</li>
  <li>{{JSxRef("Operators/Assignment_Operators", "|=", "#Bitwise_OR_assignment")}}</li>
  <li>{{JSxRef("Operators/Destructuring_assignment", "[a, b] = [1, 2]")}}</li>
  <li>{{JSxRef("Operators/Destructuring_assignment", "{a, b} = {a:1, b:2}")}}</li>
</ul>


<h2 id="函數">函數</h2>

<p>本章節說明如何使用 <a href="/zh-TW/docs/Web/JavaScript/Reference/Functions">JavaScript 函數</a> 來開發您的應用程式。</p>

<ul>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Functions/arguments"><code>arguments</code></a></li>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Functions/Arrow_functions">Arrow functions</a></li>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Functions/Default_parameters">Default parameters</a></li>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Functions/rest_parameters">Rest parameters</a></li>
</ul>

<h2 id="其他參考頁面">其他參考頁面</h2>

<ul>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Lexical_grammar">Lexical grammar</a></li>
 <li><a href="/zh-TW/docs/Web/JavaScript/Data_structures">Data types and data structures</a></li>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Strict_mode">Strict mode</a></li>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features">Deprecated features</a></li>
</ul>