aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/web/javascript/new_in_javascript
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-tw/web/javascript/new_in_javascript')
-rw-r--r--files/zh-tw/web/javascript/new_in_javascript/1.1/index.html71
-rw-r--r--files/zh-tw/web/javascript/new_in_javascript/1.2/index.html89
-rw-r--r--files/zh-tw/web/javascript/new_in_javascript/1.3/index.html138
-rw-r--r--files/zh-tw/web/javascript/new_in_javascript/1.4/index.html25
-rw-r--r--files/zh-tw/web/javascript/new_in_javascript/1.5/index.html37
-rw-r--r--files/zh-tw/web/javascript/new_in_javascript/1.6/index.html87
-rw-r--r--files/zh-tw/web/javascript/new_in_javascript/1.7/index.html600
-rw-r--r--files/zh-tw/web/javascript/new_in_javascript/1.8.1/index.html41
-rw-r--r--files/zh-tw/web/javascript/new_in_javascript/1.8.5/index.html132
-rw-r--r--files/zh-tw/web/javascript/new_in_javascript/1.8/index.html125
-rw-r--r--files/zh-tw/web/javascript/new_in_javascript/index.html71
11 files changed, 1416 insertions, 0 deletions
diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.1/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.1/index.html
new file mode 100644
index 0000000000..1095a343b3
--- /dev/null
+++ b/files/zh-tw/web/javascript/new_in_javascript/1.1/index.html
@@ -0,0 +1,71 @@
+---
+title: New in JavaScript 1.1
+slug: Web/JavaScript/New_in_JavaScript/1.1
+translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.1
+---
+<div>{{jsSidebar("New_in_JS")}}</div>
+
+<p>The following is a changelog for JavaScript from Netscape Navigator 2.0 to 3.0. The old Netscape documentation references this as <a href="https://web.archive.org/web/20060318153542/wp.netscape.com/eng/mozilla/3.0/handbook/javascript/index.html">"Features added after version 1"</a>. Netscape Navigator 3.0 was released on August 19, 1996. Netscape Navigator 3.0 was the second major version of the browser with JavaScript support.</p>
+
+<h2 id="JavaScript_versions">JavaScript versions</h2>
+
+<p>Netscape Navigator 3.0 also introduced JavaScript language versions.</p>
+
+<pre class="brush: html">&lt;SCRIPT LANGUAGE="JavaScript"&gt; &lt;!-- JavaScript for Navigator 2.0. --&gt;
+&lt;SCRIPT LANGUAGE="JavaScript1.1"&gt; &lt;!-- JavaScript for Navigator 3.0. --&gt;</pre>
+
+<h2 id="New_features_in_JavaScript_1.1">New features in JavaScript 1.1</h2>
+
+<h3 id="New_objects">New objects</h3>
+
+<ul>
+ <li>{{jsxref("Array")}}</li>
+ <li>{{jsxref("Boolean")}}</li>
+ <li>{{jsxref("Function")}}</li>
+ <li>{{jsxref("Number")}}</li>
+</ul>
+
+<h3 id="New_properties">New properties</h3>
+
+<ul>
+ <li>{{jsxref("Number.MAX_VALUE")}}</li>
+ <li>{{jsxref("Number.MIN_VALUE")}}</li>
+ <li>{{jsxref("NaN")}}</li>
+ <li>{{jsxref("Number.NEGATIVE_INFINITY")}}</li>
+ <li>{{jsxref("Number.POSITIVE_INFINITY")}}</li>
+</ul>
+
+<h3 id="New_methods">New methods</h3>
+
+<ul>
+ <li>{{jsxref("Array.prototype.join()")}}</li>
+ <li>{{jsxref("Array.prototype.reverse()")}}</li>
+ <li>{{jsxref("Array.prototype.sort()")}}</li>
+ <li>{{jsxref("Array.prototype.split()")}}</li>
+</ul>
+
+<h3 id="New_operators">New operators</h3>
+
+<ul>
+ <li><code><a href="/zh-TW/docs/Web/JavaScript/Reference/Operators/typeof">typeof</a></code></li>
+ <li><code><a href="/zh-TW/docs/Web/JavaScript/Reference/Operators/void">void</a></code></li>
+</ul>
+
+<h3 id="Other_new_features">Other new features</h3>
+
+<ul>
+ <li><code><a href="/zh-TW/docs/Web/HTML/Element/noscript">&lt;noscript&gt;</a></code></li>
+ <li><a href="/zh-TW/docs/Archive/Web/LiveConnect">LiveConnect</a>. Communication between Java and JavaScript.</li>
+</ul>
+
+<h2 id="Changed_functionality_in_JavaScript_1.1">Changed functionality in JavaScript 1.1</h2>
+
+<ul>
+ <li>"Object deletion". You can remove an object by setting its object reference to <code>null</code>.</li>
+ <li><code>constructor</code> and <code>prototype</code> properties on objects added.</li>
+ <li><code><a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/eval">eval()</a></code> is now a method of every object (was previously a built-in function); it evaluates a string of JavaScript code in the context of the specified object.</li>
+ <li><code><a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Math/random">Math.random()</a></code> now works on every platform.</li>
+ <li><code><a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Object/toString">toString()</a></code>: Added radix parameter, which specifies the base to use for representing numeric values.</li>
+ <li><code><a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/isNaN">isNaN()</a></code> now works on every platform (not only Unix anymore)</li>
+ <li><code><a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/parseFloat">parseFloat()</a></code> and <code><a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/parseInt">parseint()</a></code> now return <code>NaN</code> on all platforms, if the first character of the specified string cannot be converted to a number; in previous releases, it returned <code>NaN</code> on Solaris and Irix and zero on all other platforms.</li>
+</ul>
diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.2/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.2/index.html
new file mode 100644
index 0000000000..3c5db395fc
--- /dev/null
+++ b/files/zh-tw/web/javascript/new_in_javascript/1.2/index.html
@@ -0,0 +1,89 @@
+---
+title: New in JavaScript 1.2
+slug: Web/JavaScript/New_in_JavaScript/1.2
+translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.2
+---
+<div>{{jsSidebar("New_in_JS")}}</div>
+
+<p>The following is a changelog for JavaScript from Netscape Navigator 3.0 to 4.0. The old Netscape documentation can be found on <a href="https://web.archive.org/web/19971015223714/http://developer.netscape.com/library/documentation/communicator/jsguide/js1_2.htm">archive.org</a>. Netscape Navigator 4.0 was released on June 11, 1997. Netscape Navigator 4.0 was the third major version of the browser with JavaScript support.</p>
+
+<h2 id="JavaScript_versions">JavaScript versions</h2>
+
+<p>Netscape Navigator 4.0 executes JavaScript language versions up to 1.2. Note that Netscape Navigator 3.0 and earlier ignored scripts with the language attribute set to "JavaScript1.2" and higher.</p>
+
+<pre class="brush: html">&lt;SCRIPT LANGUAGE="JavaScript1.1"&gt; &lt;!-- JavaScript for Navigator 3.0. --&gt;
+&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt; &lt;!-- JavaScript for Navigator 4.0. --&gt;</pre>
+
+<h2 id="New_features_in_JavaScript_1.2">New features in JavaScript 1.2</h2>
+
+<h3 id="New_objects">New objects</h3>
+
+<ul>
+ <li>You can create objects using literal notation (inspired by dictionary literal syntax from Python 1.x).</li>
+ <li>Arrays can now be created using literal notation (inspired by list literal syntax from Python 1.x).</li>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Functions_and_function_scope/arguments">arguments</a></li>
+</ul>
+
+<h3 id="New_properties">New properties</h3>
+
+<ul>
+ <li>{{jsxref("Function.arity")}}</li>
+</ul>
+
+<h3 id="New_methods">New methods</h3>
+
+<ul>
+ <li>{{jsxref("Array.prototype.concat()")}}</li>
+ <li>{{jsxref("Array.prototype.slice()")}}</li>
+ <li>{{jsxref("String.prototype.charCodeAt()")}}</li>
+ <li>{{jsxref("String.prototype.concat()")}}</li>
+ <li>{{jsxref("String.fromCharCode()")}}</li>
+ <li>{{jsxref("String.prototype.match()")}}</li>
+ <li>{{jsxref("String.prototype.replace()")}}</li>
+ <li>{{jsxref("String.prototype.search()")}}</li>
+ <li>{{jsxref("String.prototype.slice()")}}</li>
+ <li>{{jsxref("String.prototype.substr()")}}</li>
+</ul>
+
+<h3 id="New_operators">New operators</h3>
+
+<ul>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Operators/delete"><code>delete</code></a></li>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Equality_comparisons_and_when_to_use_them">Equality operators</a> (<code>==</code> and <code>!=</code>)</li>
+</ul>
+
+<h3 id="New_statements">New statements</h3>
+
+<ul>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/label">Labeled</a> statements</li>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/switch"><code>switch</code></a></li>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/do...while"><code>do...while</code></a></li>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/import"><code>import</code></a></li>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/export"><code>export</code></a></li>
+</ul>
+
+<h3 id="Other_new_features">Other new features</h3>
+
+<ul>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Guide/Regular_Expressions">Regular Expressions</a></li>
+ <li><a href="https://web.archive.org/web/19971015223714/http://developer.netscape.com/library/documentation/communicator/jsguide/js1_2.htm">Signed scripts</a></li>
+</ul>
+
+<h2 id="Changed_functionality_in_JavaScript_1.2">Changed functionality in JavaScript 1.2</h2>
+
+<ul>
+ <li>You can now nest functions within functions.</li>
+ <li>Number now converts a specified object to a number.</li>
+ <li>Number now produces <code>NaN</code> rather than an error if <code>x</code> is a string that does not contain a well-formed numeric literal.</li>
+ <li>String now converts a specified object to a string.</li>
+ <li>{{jsxref("Array.prototype.sort()")}} now works on all platforms. It no longer converts undefined elements to null and sorts them to the high end of the array.</li>
+ <li>{{jsxref("String.prototype.split()")}}
+ <ul>
+ <li>It can take a regular expression argument, as well as a fixed string, by which to split the object string.</li>
+ <li>It can take a limit count so that it won't include trailing empty elements in the resulting array.</li>
+ </ul>
+ </li>
+ <li>{{jsxref("String.prototype.substring()")}}: no longer swaps index numbers when the first index is greater than the second.</li>
+ <li><code>toString()</code>: now converts the object or array to a literal.</li>
+ <li>The <a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/break"><code>break</code></a> and <a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/continue"><code>continue</code></a> statements can now be used with the new labeled statement.</li>
+</ul>
diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.3/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.3/index.html
new file mode 100644
index 0000000000..635126dc4f
--- /dev/null
+++ b/files/zh-tw/web/javascript/new_in_javascript/1.3/index.html
@@ -0,0 +1,138 @@
+---
+title: New in JavaScript 1.3
+slug: Web/JavaScript/New_in_JavaScript/1.3
+translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.3
+---
+<div>{{jsSidebar("New_in_JS")}}</div>
+
+<p>The following is a changelog for JavaScript from Netscape Navigator 4.0 to 4.5. The old Netscape documentation can be found on <a href="https://web.archive.org/web/20000815081640/http://developer.netscape.com/docs/manuals/communicator/jsref/js13.html">archive.org</a>. Netscape Navigator 4.5 was released on October 19, 1998.</p>
+
+<p>The most significant change in JavaScript 1.3 was compliance with ECMA-262 and Unicode by removing inconsistencies between JavaScript 1.2 and the new ECMA standard (which was published in June 1997). Additional features of version 1.2, at the time not specified by ECMA-262 were kept in the JavaScript language (see below for a list of differences).</p>
+
+<h2 id="JavaScript_versions">JavaScript versions</h2>
+
+<p>Netscape Communicator and Navigator 4.06 and 4.5 executes JavaScript language versions up to 1.3. Note that Communicator and Navigator 4.0-4.05 and earlier ignored scripts with the language attribute set to "JavaScript1.3" and higher.</p>
+
+<pre class="brush: html">&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt; &lt;!-- JavaScript for Navigator 4.0. --&gt;
+&lt;SCRIPT LANGUAGE="JavaScript1.3"&gt; &lt;!-- JavaScript for Navigator 4.5. --&gt;</pre>
+
+<h2 id="New_features_in_JavaScript_1.3">New features in JavaScript 1.3</h2>
+
+<h3 id="New_globals">New globals</h3>
+
+<ul>
+ <li>{{jsxref("NaN")}}</li>
+ <li>{{jsxref("Infinity")}}</li>
+ <li>{{jsxref("undefined")}}</li>
+</ul>
+
+<h3 id="New_methods">New methods</h3>
+
+<ul>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/isFinite"><code>isFinite()</code></a></li>
+ <li>{{jsxref("Function.prototype.call()")}}</li>
+ <li>{{jsxref("Function.prototype.apply()")}}</li>
+ <li>{{jsxref("Date.UTC()")}}</li>
+ <li>{{jsxref("Date.prototype.getFullYear()")}}</li>
+ <li>{{jsxref("Date.prototype.setFullYear()")}}</li>
+ <li>{{jsxref("Date.prototype.getMilliseconds()")}}</li>
+ <li>{{jsxref("Date.prototype.setMilliseconds()")}}</li>
+ <li>{{jsxref("Date.prototype.getUTCFullYear()")}}</li>
+ <li>{{jsxref("Date.prototype.getUTCMonth()")}}</li>
+ <li>{{jsxref("Date.prototype.getUTCDate()")}}</li>
+ <li>{{jsxref("Date.prototype.getUTCHours()")}}</li>
+ <li>{{jsxref("Date.prototype.getUTCMinutes()")}}</li>
+ <li>{{jsxref("Date.prototype.getUTCSeconds()")}}</li>
+ <li>{{jsxref("Date.prototype.getUTCMilliseconds()")}}</li>
+ <li>{{jsxref("Date.prototype.toUTCString()")}}</li>
+ <li>{{jsxref("Date.prototype.setUTCFullYear()")}}</li>
+ <li>{{jsxref("Date.prototype.setUTCMonth()")}}</li>
+ <li>{{jsxref("Date.prototype.setUTCDate()")}}</li>
+ <li>{{jsxref("Date.prototype.setUTCHours()")}}</li>
+ <li>{{jsxref("Date.prototype.setUTCMinutes()")}}</li>
+ <li>{{jsxref("Date.prototype.setUTCSeconds()")}}</li>
+ <li>{{jsxref("Date.prototype.setUTCMilliseconds()")}}</li>
+</ul>
+
+<h3 id="Other_new_features">Other new features</h3>
+
+<ul>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Operators/Comparison_Operators#Using_the_Equality_Operators" title="JavaScript/Reference/Operators/Comparison_Operators#Using_the_Equality_Operators">Strict equality operators</a></li>
+ <li>Unicode support</li>
+ <li>A JavaScript Console was introduced.</li>
+</ul>
+
+<h2 id="Changed_functionality_in_JavaScript_1.3">Changed functionality in JavaScript 1.3</h2>
+
+<ul>
+ <li>Changes to <a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Date" title="JavaScript/Reference/Global_Objects/Date"><code>Date</code></a> to conform with ECMA-262
+
+ <ul>
+ <li>New constructor <code>Date(year, month, day, [,<em>hours</em> [<em>, minutes</em> [<em>, seconds</em> [<em>, milliseconds</em> ]]]])</code></li>
+ <li>Additional method parameters:
+ <ul>
+ <li><code>setMonth(month[, date])</code></li>
+ <li><code>setHours(hours[, min[, sec[, ms]]])</code></li>
+ <li><code>setMinutes(min[, sec[, ms]])</code></li>
+ <li><code>setSeconds(sec[, ms])</code></li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+ <li>The length of an array (property length) is now an unsigned, 32-bit integer.</li>
+ <li>{{jsxref("Array.prototype.push()")}}: In JavaScript 1.2, the <code>push</code> method returned the last element added to an array. Under JavaScript 1.3, <code>push</code> returns the new length of the array.</li>
+ <li>{{jsxref("Array.prototype.slice()")}}: In JavaScript 1.2, the <code>splice</code> method returned the element removed, if only one element was removed (<code>howMany</code> parameter is <code>1</code>). In JavaScript 1.3, <code>splice</code> always returns an array containing the removed elements. If one element is removed, an array of one element is returned.</li>
+ <li><a href="https://web.archive.org/web/20000815081640/http://developer.netscape.com/docs/manuals/communicator/jsref/js13.html#replace">Changes</a> to {{jsxref("String.prototype.replace()")}}.</li>
+ <li><a href="https://web.archive.org/web/20000815081640/http://developer.netscape.com/docs/manuals/communicator/jsref/js13.html#Boolean">Changes</a> to the {{jsxref("Boolean")}} object.</li>
+ <li><a href="https://web.archive.org/web/20000815081640/http://developer.netscape.com/docs/manuals/communicator/jsref/js13.html#toString">Changes</a> to <code>toString()</code>.</li>
+</ul>
+
+<h2 id="Non-ECMA-262_features_of_JavaScript_1.3">Non-ECMA-262 features of JavaScript 1.3</h2>
+
+<p>The following is a comparison between the June 1998 version of ECMA-262 and JavaScript 1.3. The following features were not part of the standard at that time, but implemented in JavaScript 1.3.</p>
+
+<h3 id="Keywords_and_operators">Keywords and operators</h3>
+
+<ul>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Operators/Comparison_Operators#Using_the_Equality_Operators">Strict equality operators</a></li>
+ <li>vertical tab (<code>\v</code> or <code>\u000B</code>) as an escape sequence.</li>
+</ul>
+
+<h3 id="Statements">Statements</h3>
+
+<ul>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/label"><code>label</code></a></li>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/switch"><code>switch</code></a></li>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/do...while"><code>do...while</code></a></li>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/export"><code>export</code></a></li>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/import"><code>import</code></a></li>
+</ul>
+
+<h3 id="Built-in_objects">Built-in objects</h3>
+
+<ul>
+ <li>{{jsxref("RegExp")}}</li>
+</ul>
+
+<h3 id="Methods_of_built-in_objects">Methods of built-in objects</h3>
+
+<ul>
+ <li><code><a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Object/toSource">toSource()</a></code></li>
+ <li>{{jsxref("Object.prototype.watch()")}}</li>
+ <li>{{jsxref("Object.prototype.unwatch()")}}</li>
+ <li>{{jsxref("Function.arity")}}</li>
+ <li>{{jsxref("Function.prototype.apply()")}}</li>
+ <li>{{jsxref("Function.prototype.call()")}}</li>
+ <li>{{jsxref("Array.prototype.concat()")}}</li>
+ <li>{{jsxref("Array.prototype.pop()")}}</li>
+ <li>{{jsxref("Array.prototype.push()")}}</li>
+ <li>{{jsxref("Array.prototype.shift()")}}</li>
+ <li>{{jsxref("Array.prototype.slice()")}}</li>
+ <li>{{jsxref("Array.prototype.splice()")}}</li>
+ <li>{{jsxref("String.prototype.concat()")}}</li>
+ <li>{{jsxref("String.prototype.concat()")}}</li>
+ <li>{{jsxref("String.prototype.match()")}}</li>
+ <li>{{jsxref("String.prototype.search()")}}</li>
+ <li>{{jsxref("String.prototype.slice()")}}</li>
+ <li>{{jsxref("String.prototype.substr()")}}</li>
+</ul>
diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.4/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.4/index.html
new file mode 100644
index 0000000000..d44fe1eb71
--- /dev/null
+++ b/files/zh-tw/web/javascript/new_in_javascript/1.4/index.html
@@ -0,0 +1,25 @@
+---
+title: New in JavaScript 1.4
+slug: Web/JavaScript/New_in_JavaScript/1.4
+translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.4
+---
+<div>{{jsSidebar("New_in_JS")}}</div>
+
+<p>The following is a changelog for JavaScript 1.4, which was only used for Netscape's server side JavaScript released in 1999. The old Netscape documentation can be found on <a href="https://web.archive.org/web/20040802225238/http://developer.netscape.com/docs/manuals/js/core/jsref/index.htm">archive.org</a>.</p>
+
+<h2 id="New_features_in_JavaScript_1.4">New features in JavaScript 1.4</h2>
+
+<ul>
+ <li>Exception handling (<a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/throw"><code>throw</code></a> and <a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/try...catch"><code>try...catch</code></a>)</li>
+ <li><code><a href="/zh-TW/docs/Web/JavaScript/Reference/Operators/in">in</a></code> operator</li>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Operators/instanceof"><code>instanceof</code></a> operator</li>
+</ul>
+
+<h2 id="Changed_functionality_in_JavaScript_1.4">Changed functionality in JavaScript 1.4</h2>
+
+<ul>
+ <li><code><a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/eval" title="JavaScript/Reference/Global_Functions/Eval">eval()</a></code> changes (cannot be called indirectly and no longer a method of <code>Object</code>)</li>
+ <li><code><a href="/zh-TW/docs/Web/JavaScript/Reference/Functions_and_function_scope/arguments" title="JavaScript/Reference/Functions/arguments">arguments</a></code> not a property of functions</li>
+ <li>Deprecated {{jsxref("Function.arity")}} in favor of {{jsxref("Function.length")}}</li>
+ <li>Changes to <a href="/zh-TW/docs/Archive/Web/LiveConnect">LiveConnect</a></li>
+</ul>
diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.5/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.5/index.html
new file mode 100644
index 0000000000..b516506dcd
--- /dev/null
+++ b/files/zh-tw/web/javascript/new_in_javascript/1.5/index.html
@@ -0,0 +1,37 @@
+---
+title: New in JavaScript 1.5
+slug: Web/JavaScript/New_in_JavaScript/1.5
+translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.5
+---
+<div>{{jsSidebar("New_in_JS")}}</div>
+
+<p>The following is a changelog for JavaScript 1.5. This version was included in Netscape Navigator 6.0 was released on November 14, 2000 and was also used in later versions of Netscape Navigator and Firefox 1.0. You can compare JavaScript 1.5 to JScript version 5.5 and Internet Explorer 5.5, which was released in July 2000. The corresponding ECMA standard is ECMA-262 Edition 3 (from December 1999).</p>
+
+<h2 id="New_features_in_JavaScript_1.5">New features in JavaScript 1.5</h2>
+
+<ul>
+ <li>{{jsxref("Number.prototype.toExponential()")}}</li>
+ <li>{{jsxref("Number.prototype.toFixed()")}}</li>
+ <li>{{jsxref("Number.prototype.toPrecision()")}}</li>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/const"><code>const</code></a></li>
+ <li>Multiple catch clauses in a <a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/try...catch"><code>try...catch</code></a> statement are supported.</li>
+ <li>JavaScript authors can now add getters and setters to their objects.</li>
+</ul>
+
+<h2 id="Changed_functionality_in_JavaScript_1.5">Changed functionality in JavaScript 1.5</h2>
+
+<ul>
+ <li>Runtime errors are now reported as exceptions.</li>
+ <li>Regular Expression changes:
+ <ul>
+ <li>Quantifiers — +, *, ? and {} — can now be followed by a ? to force them to be non-greedy.</li>
+ <li>Non-capturing parentheses, (?:x) can be used instead of capturing parentheses, (x). When non-capturing parentheses are used, matched subexpressions are not available as back-references.</li>
+ <li>Positive and negative lookahead assertions are supported. Both assert a match depending on what follows the string being matched.</li>
+ <li>The m flag has been added to specify that the regular expression should match over multiple lines.</li>
+ </ul>
+ </li>
+ <li>Functions can now be declared inside an if clause.</li>
+ <li>
+ <p>Functions can now be declared inside an expression.</p>
+ </li>
+</ul>
diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.6/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.6/index.html
new file mode 100644
index 0000000000..0c3ffa0f25
--- /dev/null
+++ b/files/zh-tw/web/javascript/new_in_javascript/1.6/index.html
@@ -0,0 +1,87 @@
+---
+title: JavaScript 1.6 新鮮事
+slug: Web/JavaScript/New_in_JavaScript/1.6
+tags:
+ - E4X
+ - JavaScript
+ - JavaScript_version_overviews
+ - 所有類別
+translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.6
+---
+<div>{{jsSidebar("New_in_JS")}}</div>
+
+<p>JavaScript 1.6 推出了幾項新機能:E4X、幾個新的 <code>Array</code> 方法、以及 Array 與 String 的通用化。</p>
+
+<p><a href="/zh_tw/Firefox_1.5" title="zh_tw/Firefox_1.5">Firefox 1.5</a> 或更新版的瀏覽器支援 JavaScript 1.6。</p>
+
+<h3 id="E4X" name="E4X">E4X</h3>
+
+<p>ECMAScript for XML(<a href="/zh_tw/E4X" title="zh_tw/E4X">E4X</a>)是個在 <a href="/zh_tw/JavaScript" title="zh_tw/JavaScript">JavaScript</a> 內建立並處理 <a href="/zh_tw/XML" title="zh_tw/XML">XML</a> 內容的強力技術。我們將持續改進我們對 E4X 的支援,包括新增與既有的 <a href="/zh_tw/DOM" title="zh_tw/DOM">DOM</a> 進行透明化的整合,不過建立以 XML 為基礎的 Web 應用程式的開發者已可受益於 Firefox 1.5 對 E4X 的支援。</p>
+
+<p>使用 E4X 時還是可以使用標準的 MIME 類型:</p>
+
+<pre>&lt;script type="text/javascript"&gt;
+</pre>
+
+<p>不過,E4X 語法可能會和把 Script 放進 HTML 註解以避免舊瀏覽器讀取的現行方式(<code>&lt;!--...--&gt;</code>)發生衝突。E4X 也有可能與把 Script 放進 XML CDATA 區段(<code>&lt;![CDATA{{ mediawiki.external('...') }}]&gt;</code>)讓 Script 可以直接使用 "&lt;" 和 "&gt;" 符號(這並不適用於 HTML)的現行方式發生衝突。如果你不斷的見到莫名其妙的語法錯誤,那就把 "; e4x=1" 加到 MIME 類型裡:</p>
+
+<pre>&lt;script type="text/javascript; e4x=1"&gt;
+</pre>
+
+<p>注意,擴充套件中的 Script 一定會把 HTML 註解當作 E4X 的語法來處理。也就是說,"e4x=1" 是預設的。</p>
+
+<p>E4X 已在 <a href="/zh_tw/E4X/使用_E4X_處理_XML" rel="internal" title="zh tw/E4X/使用 E4X 處理 XML">使用 E4X 處理 XML</a> 一文中說明。</p>
+
+<h3 id="Array_的擴充" name="Array_的擴充">Array 的擴充</h3>
+
+<p>在此有七個新的 <code><a href="/zh_tw/Core_JavaScript_1.5_參考/物件/Array" title="zh tw/Core JavaScript 1.5 參考/物件/Array">Array</a></code> 方法,並且可以分成兩大類,項目定位方法以及迭代方法。項目定位方法有:</p>
+
+<ul>
+ <li><code><a href="/zh_tw/Core_JavaScript_1.5_參考/物件/Array/indexOf" title="zh tw/Core JavaScript 1.5 參考/物件/Array/indexOf">indexOf()</a></code> - 返回第一次出現指定項目的索引。</li>
+ <li><code><a href="/zh_tw/Core_JavaScript_1.5_參考/物件/Array/lastIndexOf" title="zh tw/Core JavaScript 1.5 參考/物件/Array/lastIndexOf">lastIndexOf()</a></code> - 返回最後一次出現指定項目的索引。</li>
+</ul>
+
+<p>迭代方法有:</p>
+
+<ul>
+ <li><code><a href="/zh_tw/Core_JavaScript_1.5_參考/物件/Array/every" title="zh tw/Core JavaScript 1.5 參考/物件/Array/every">every()</a></code> - 對陣列中的每一個項目執行函數,如果函數返回 true 就繼續下去。如果每一個項目都返回 true,就返回 true。</li>
+ <li><code><a href="/zh_tw/Core_JavaScript_1.5_參考/物件/Array/filter" title="zh tw/Core JavaScript 1.5 參考/物件/Array/filter">filter()</a></code> - 對陣列中的每一個項目執行函數,並以陣列返回函數執行結果為 true 的項目。</li>
+ <li><code><a href="/zh_tw/Core_JavaScript_1.5_參考/物件/Array/forEach" title="zh tw/Core JavaScript 1.5 參考/物件/Array/forEach">forEach()</a></code> - 對陣列中的每一個項目執行函數。</li>
+ <li><code><a href="/zh_tw/Core_JavaScript_1.5_參考/物件/Array/map" title="zh tw/Core JavaScript 1.5 參考/物件/Array/map">map()</a></code> - 對陣列中的每一個項目執行函數,並以陣列返回執行結果。</li>
+ <li><code><a href="/zh_tw/Core_JavaScript_1.5_參考/物件/Array/some" title="zh tw/Core JavaScript 1.5 參考/物件/Array/some">some()</a></code> - 對陣列中的每一個項目執行函數,如果函數返回 false 就繼續下去。如果有一個項目返回 true,就返回 true。</li>
+</ul>
+
+<p>閱讀 <a href="/zh_tw/Core_JavaScript_1.5_教學/陣列的運用#於_JavaScript_1.6_引入" rel="internal" title="zh tw/Core JavaScript 1.5 教學/陣列的運用#於 JavaScript 1.6 引入">陣列的運用</a> 以取得更多資訊,或見 Nicholas C. Zakas 的文章,<span class="exlink"><a class="external" href="http://www.webreference.com/programming/javascript/ncz/column4/index.html" title="http://www.webreference.com/programming/javascript/ncz/column4/index.html">Mozilla's New Array Methods</a></span>。</p>
+
+<h3 id="Array_.E8.88.87_String_.E5.85.B1.E9.80.9A_.28generics.29" name="Array_.E8.88.87_String_.E5.85.B1.E9.80.9A_.28generics.29">Array 與 String 的通用化</h3>
+
+<p>有時候你會想要把陣列的方法套用在字串上。這樣做的話,便是把字串視為字元的陣列。比如說,如果要檢查變數 <var>str</var> 裡面的每個字元都是字母,你就會這樣寫:</p>
+
+<pre>function isLetter(character) {
+ return (character &gt;= "a" &amp;&amp; character &lt;= "z");
+}
+
+if (Array.prototype.every.call(str, isLetter))
+ alert("字串 '" + str + "' 只有包含字母!");
+</pre>
+
+<p>這樣的寫法相當耗事,所以 JavaScript 1.6 有比較簡短的寫法:</p>
+
+<pre>if (Array.every(str, isLetter))
+ alert("字串 '" + str + "' 只有包含字母!");
+</pre>
+
+<p>同理,你可以把 String 方法用在任何物件上:</p>
+
+<pre>var num = 15;
+alert(String.replace(num, /5/, '2'));
+</pre>
+
+<h3 id=".E5.8F.A6.E5.A4.96.E5.8F.83.E8.A6.8B" name=".E5.8F.A6.E5.A4.96.E5.8F.83.E8.A6.8B">參閱</h3>
+
+<ul>
+ <li>自 <a href="/zh_tw/Firefox_2_技術文件" title="zh_tw/Firefox_2_技術文件">Firefox 2</a> 起開始支援的 <a href="/zh_tw/JavaScript_1.7_新鮮事" title="zh_tw/JavaScript_1.7_新鮮事">JavaScript 1.7</a>。</li>
+ <li><a href="/zh_tw/Core_JavaScript_1.5_教學/陣列的運用#近似陣列的物件的運用" rel="internal" title="zh tw/Core JavaScript 1.5 教學/陣列的運用#近似陣列的物件的運用">近似陣列的物件的運用</a>。</li>
+</ul>
+
+<p>{{ languages( { "en": "en/New_in_JavaScript_1.6", "es": "es/Novedades_en_JavaScript_1.6", "fr": "fr/Nouveaut\u00e9s_dans_JavaScript_1.6", "ja": "ja/New_in_JavaScript_1.6", "pl": "pl/Nowo\u015bci_w_JavaScript_1.6", "ru": "ru/\u041d\u043e\u0432\u043e\u0435_\u0432_JavaScript_1.6", "zh-cn": "cn/New_in_JavaScript_1.6" } ) }}</p>
diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.7/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.7/index.html
new file mode 100644
index 0000000000..9f94bb6e88
--- /dev/null
+++ b/files/zh-tw/web/javascript/new_in_javascript/1.7/index.html
@@ -0,0 +1,600 @@
+---
+title: JavaScript 1.7 新鮮事
+slug: Web/JavaScript/New_in_JavaScript/1.7
+tags:
+ - JavaScript
+ - JavaScript_version_overviews
+ - 待翻譯
+ - 所有類別
+translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.7
+---
+<div>{{jsSidebar("New_in_JS")}}</div>
+
+<p>{{ Fx_minversion_header(2) }}</p>
+
+<p>JavaScript 1.7 是個程式語言上的更新,新推出了幾項新功能,諸如特別的產生器(generator)、迭代器(iterator)、陣列簡約式(array comprehension)、<code>let</code> 表達式、以及分割代入(destructuring assignment)。它也包含了所有 <a href="/zh_tw/JavaScript_1.6_新鮮事" title="zh_tw/JavaScript_1.6_新鮮事">JavaScript 1.6</a> 的功能。</p>
+
+<p>從 <a href="/zh_tw/Firefox_2_技術文件" title="zh_tw/Firefox_2_技術文件">Firefox 2</a> 起,開始支援 JavaScript 1.7。</p>
+
+<p>本文章使用的程式碼範例可以用 JavaScript shell 實驗。請參見 <a href="/zh_tw/JavaScript_shell_入門" title="zh tw/JavaScript shell 入門">JavaScript shell 入門</a> 以得知如何建造及使用 shell。</p>
+
+<h2 id="使用_JavaScript_1.7" name="使用_JavaScript_1.7">使用 JavaScript 1.7</h2>
+
+<p>為了使用 JavaScript 1.7 的一些新機能,你必須在 HTML 或 XUL 的原始碼中指明你希望使用 JavaScript 1.7:</p>
+
+<pre class="eval"> &lt;script type="application/javascript;version=1.7"/&gt;
+</pre>
+
+<p>當使用 <a href="/zh_tw/JavaScript_shell_入門" title="zh tw/JavaScript shell 入門">JavaScript shell</a> 的時候,你需要設定想要使用的版本,可以在命令列加上 <code>-version 170</code> 或使用 <code>version()</code> 函式:</p>
+
+<pre class="eval"> version(170);
+</pre>
+
+<p>當碰到必須使用新關鍵字「yield」和「let」的機能時,你必須指定版本 1.7,因為既有的程式可能會將那些關鍵字判讀為變數或函數的名字。當某項機能並未引入新關鍵字時(分割代入和陣列簡約式),可不必指定 JavaScript 的版本。</p>
+
+<h2 id="產生器與迭代器" name="產生器與迭代器">產生器與迭代器</h2>
+
+<p>當開發中的代碼涉及到迭代演算法時(例如迭代整個列表或在同一組資料上反覆進行計算),在計算處理期間還需要維護狀態變數的值。傳統上,你必須使用 Callback 函數以取得迭代演算法的立即值。</p>
+
+<h3 id="產生器" name="產生器">產生器</h3>
+
+<p>思考下面的迭代演算法,他會計算費伯納契數︰</p>
+
+<pre class="brush: js">function do_callback(num) {
+ document.write(num + "&lt;BR&gt;\n");
+}
+
+function fib() {
+ var i = 0, j = 1, n = 0;
+ while (n &lt; 10) {
+ do_callback(i);
+ var t = i;
+ i = j;
+ j += t;
+ n++;
+ }
+}
+
+fib();
+</pre>
+
+<p>代碼中使用的 Callback 常式會在演算法每一次的迭代步驟中進行運算。在本例中,每一個費伯納契數只是簡單的輸出到控制台上。</p>
+
+<p>產生器和迭代器的結合運用可提供較佳的新方式來完成這一動作。讓我們來看看使用產生器所寫成的費伯納契數常式的樣子︰</p>
+
+<pre class="brush: js">function fib() {
+ var i = 0, j = 1;
+ while (true) {
+ yield i;
+ var t = i;
+ i = j;
+ j += t;
+ }
+}
+
+var g = fib();
+for (var i = 0; i &lt; 10; i++) {
+ document.write(g.next() + "&lt;BR&gt;\n");
+}
+</pre>
+
+<p>內含 <code>yield</code> 關鍵字的函數便是產生器。當你呼叫函數的時候,函數的形式參數受限於實際的參數,但函數本身並不會被實際進行求值。取而代之的是產生器迭代器(generator-iterator)的返回。每當呼叫產生器迭代器的 <code>next()</code> 方法就進行迭代演算法的下一步驟。每一步驟的值都是由 <code>yield</code> 關鍵字的值所指定。可以把 <code>yield</code> 想成是產生器迭代器版本的 <code>return</code>,並指明演算法每一回迭代之間的分界線。每當你呼叫 <code>next()</code> 的時候,產生器的代碼會從 <code>yield</code> 之後的語句開始恢復執行。</p>
+
+<p>你可以反覆呼叫產生器迭代器的 <code>next()</code> 方法,直到達到你所想要的結果為止。在本例中,我們可以取得任意多的費伯納契數,只要我們持續呼叫 <code>g.next()</code> 直到拿到所需數目的結果為止。</p>
+
+<h5 id="Resuming_a_generator_at_a_specific_point" name="Resuming_a_generator_at_a_specific_point">在指定點上恢復產生器的執行</h5>
+
+<p>產生器的 <code>next()</code> 方法一經呼叫以後產生器就會被啟動,你可以使用 <code>send()</code> 傳入指定的值,傳入的值會被視為最後一個 <code>yield</code> 的結果。產生器將會返回隨後的 <code>yield</code> 的運算元。</p>
+
+<p>你不能在任意點上啟動產生器;在你可以使用 <code>send()</code> 傳入指定值以前,你必須先以 <code>next()</code> 啟動。</p>
+
+<div class="note"><strong>附註:</strong> 有趣的一點是,呼叫 <code>send(undefined)</code> 和呼叫 <code>next()</code> 是等價的。然而,使用除了 undefined 以外的任意值來呼叫 <code>send()</code> 並啟動新生的產生器,將會導致 <code>TypeError</code> 的例外。</div>
+
+<h5 id="Exceptions_in_generators" name="Exceptions_in_generators">產生器裡的例外</h5>
+
+<p>你可以呼叫產生器的 <code>throw()</code> 方法並傳入要拋出的例外值,強制使產生器拋出例外。例外將會從產生器當下被暫停的內容中拋出,彷彿 <code>throw <em>value</em></code> 被代換成目前被暫停的 <code>yield</code> 語句。</p>
+
+<p>如果在拋出例外的過程中沒有遇到 yield,例外將會不斷擴散直到呼叫 <code>next()</code>,而隨後呼叫的 <code>next()</code> 將會導致 <code>StopIteration</code> 被拋出。</p>
+
+<h5 id="Closing_a_generator" name="Closing_a_generator">關閉產生器</h5>
+
+<p>產生器有一個 <code>close()</code> 方法可強制產生器關閉他自己。關閉產生器的作用有︰</p>
+
+<ol>
+ <li>執行產生器函數裡面所有活動中的 <code>finally</code> 子句。</li>
+ <li>如果 <code>finally</code> 子句拋出除了 <code>StopIteration</code> 以外的任何例外,例外會被擴散到 <code>close()</code> 方法的呼叫端。</li>
+ <li>結束產生器。</li>
+</ol>
+
+<h5 id="Generator_Example" name="Generator_Example">產生器的範例</h5>
+
+<p>下面的代碼驅動的產生器將會產生 100 個迴圈。</p>
+
+<pre class="brush: js">var gen = generator();
+
+function driveGenerator() {
+  if (gen.next()) {
+    window.setTimeout(driveGenerator, 0);
+  } else {
+    gen.close();
+  }
+}
+
+function generator() {
+  while (i &lt; something) {
+    /** stuff **/
+
+    ++i;
+    /** 100 loops per yield **/
+    if ((i % 100) == 0) {
+      yield true;
+    }
+  }
+  yield false;
+}
+</pre>
+
+<h3 id="迭代器" name="迭代器">迭代器</h3>
+
+<p><em>迭代器</em>是一種特殊的物件,可讓你在資料上進行迭代。</p>
+
+<p>在正常使用下,迭代器物件是「看不見的」;你並不需要直接在裡面做操作,但會使用到 JavaScript 的 <a href="/zh_tw/Core_JavaScript_1.5_教學/物件的操作語法" title="zh tw/Core JavaScript 1.5 教學/物件的操作語法"><code>for...in</code> 和 <code>for each...in</code> 語法</a> 在物件的鍵值上自然的循環。</p>
+
+<pre class="brush: js">var objectWithIterator = getObjectSomehow();
+
+for (var i in objectWithIterator)
+{
+ document.write(objectWithIterator[i] + "&lt;BR&gt;\n");
+}
+</pre>
+
+<p>如果你正在實裝你自己的迭代器物件,或者有另一個需要直接操作的迭代器,你將需要知道 <code>next</code> 方法、<code>StopIteration</code> 例外、還有 <code>__iterator__</code> 方法。</p>
+
+<p>你可以藉著呼叫 <code>Iterator(<em>objectname</em>)</code> 來為物件建立迭代器;物件的迭代器會透過物件的 <code>__iterator__</code> 方法找出來,如果沒有提供 <code>__iterator__</code> 方法,就會建立預設的迭代器。預設的迭代器會提供物件的屬性,通常是對應於 <code>for...in</code> 和 <code>for each...in</code> 的模式。如果你想要提供自訂的迭代器,你就要覆蓋 <code>__iterator__</code> 方法並返回你自訂的迭代器的實體。要從 Script 取得物件的迭代器,你就要使用 <code>Iterator(<em>obj</em>)</code> 而非直接存取 <code>__iterator__</code> 屬性。前者可用於陣列;而後者不行。</p>
+
+<p>一旦你有了迭代器以後,你就可以藉由呼叫迭代器的 <code>next()</code> 方法輕鬆的取得物件中的下一項。如果已無下一項資料,就會拋出 <code>StopIteration</code> 例外。</p>
+
+<p>下面是直接操作迭代器的簡單範例︰</p>
+
+<pre class="brush: js">var obj = {name:"Jack Bauer", username:"JackB", id:12345, agency:"CTU", region:"Los Angeles"};
+
+var it = Iterator(obj);
+
+try {
+ while (true) {
+ document.write(it.next() + "&lt;BR&gt;\n");
+ }
+} catch (err if err instanceof StopIteration) {
+ document.write("記錄結束。&lt;BR&gt;\n");
+} catch (err) {
+ document.write("未知的錯誤︰" + err.description + "&lt;BR&gt;\n");
+}
+</pre>
+
+<p>這個程式的輸出就像下面這樣︰</p>
+
+<pre>name,Jack Bauer
+username,JackB
+id,12345
+agency,CTU
+region,Los Angeles
+記錄結束。
+</pre>
+
+<p>當你正在建立你的迭代器的時候,也可以選擇性的指定第二個參數,這個參數是真假值,可表明每當你呼叫 <code>next()</code> 方法時是否只想要返回鍵的部分。把前面例子的 <code>var it = Iterator(obj);</code> 改成 <code>var it = Iterator(obj, true);</code> 會變成以下的輸出內容︰</p>
+
+<pre>name
+username
+id
+agency
+region
+記錄結束。
+</pre>
+
+<p>在這兩種情況下,返回的資料的實際順序主要是由實裝方式所決定。在此並沒有統一的資料順序。</p>
+
+<p>迭代器是用來掃描物件裡的資料的簡便方式,包括那些你沒注意到的內容。如果你需要維護應用程式無法預期的資料的話,這一點將會特別實用。</p>
+
+<h2 id="陣列簡約式" name="陣列簡約式">陣列簡約式</h2>
+
+<p>陣列簡約式的用法和產生器一樣,可提供簡便的方式進行陣列的初始化。例如︰</p>
+
+<pre class="brush: js">function range(begin, end) {
+ for (let i = begin; i &lt; end; ++i) {
+ yield i;
+ }
+}
+</pre>
+
+<p><code>range()</code> 是可返回介於 <code>begin</code> 和 <code>end</code> 之間所有的值的產生器。有了上面的定義,我們可以如下使用︰</p>
+
+<pre class="brush: js">var ten_squares = [i * i for (i in range(0, 10))];
+</pre>
+
+<p>這個預先初始化內容的新陣列 <var>ten_squares</var>,內含 <code>0..9</code> 範圍內所有數值的平方。</p>
+
+<p>在初始化陣列的時候,你可以採用任意的條件。如果你想要初始化內含 0 到 20 之間的偶數的陣列,你可以使用下面的代碼︰</p>
+
+<pre class="brush: js">var evens = [i for (i in range(0, 21)) if (i % 2 == 0)];
+</pre>
+
+<p>在 JavaScript 1.7 以前,就必須編寫成像下面這個樣子︰</p>
+
+<pre class="brush: js">var evens = [];
+for (var i=0; i &lt;= 20; i++) {
+ if (i % 2 == 0)
+ evens.push(i);
+}
+</pre>
+
+<p>陣列簡約式不只是更加的緊密,一旦熟悉了這個概念,就會發現陣列簡約式也真的更加易讀。</p>
+
+<h4 id="作用域規則" name="作用域規則">作用域規則</h4>
+
+<p>陣列簡約式中包含在方括號內部的所有東西具有內含的區塊,就像隱含了 <code>let</code> 宣告一樣。</p>
+
+<h2 id="使用_let_的區塊作用域" name="使用_let_的區塊作用域">使用 <code>let</code> 的區塊作用域</h2>
+
+<p><code>let</code> 可用來管理資料和函數的區塊作用域,在此有許多種方式︰</p>
+
+<ul>
+ <li><strong><code>let</code> 語法</strong> 可提供在區塊的作用域內部連結值與變數的方式,而不影響區塊外部相同名稱的變數的值。</li>
+ <li><strong><code>let</code> 表達式</strong> 可讓你只對單一的表達式確立變數的作用域。</li>
+ <li><strong><code>let</code> 定義</strong> 可定義區塊使變數的作用域受限於這個區塊。這個語法和 <code>var</code> 語法的用法非常類似。</li>
+ <li>你也可以使用 <code>let</code> 來確立只存在於 <code>for</code> 循環的條件式內部的變數。</li>
+</ul>
+
+<h3 id="let_語法" name="let_語法"><code>let</code> 語法</h3>
+
+<div class="warning">
+<p>The <code>let</code> block and <code>let</code> expression syntax is non-standard and will be removed in the future. Do not use them! See {{bug(1023609)}} for more details.</p>
+</div>
+
+<p><code>let</code> 語法可提供給變數一個局域作用域。他會作用於被約束在單一區塊範圍內零個以上的變數;否則,他就和 <a href="/../../../../zh_tw/Core_JavaScript_1.5_參考/語法/區塊" rel="internal" title="../../../../zh tw/Core JavaScript 1.5 參考/語法/區塊">區塊語法</a> 完全一樣。須特別注意的是,在 <code>let</code> 語法內部使用以 <code>var</code> 宣告過的變數,如果變數已在 <code>let</code> 語法外部宣告過,其作用域仍和外部的一樣;這樣的變數仍具有函數作用域。</p>
+
+<p>例如︰</p>
+
+<pre class="brush: js">var x = 5;
+var y = 0;
+
+let (x = x+10, y = 12) {
+ print(x+y + "\n");
+}
+
+print((x + y) + "\n");
+</pre>
+
+<p>程式的輸出結果會是︰</p>
+
+<pre>27
+5
+</pre>
+
+<p>代碼區塊的規則和 JavaScript 中的任何代碼區塊完全一樣。他會有自己的使用 <code>let</code> 宣告所確立的局域變數。</p>
+
+<div class="note"><strong>附註:</strong> 當使用 <code>let</code> 語法的時候,<code>let</code> 後面的圓括弧是必要的。漏掉圓括弧將導致語法錯誤。</div>
+
+<h4 id="作用域規則" name="作用域規則">作用域規則</h4>
+
+<p>用 <code>let</code> 所定義的變數其作用域即為 <code>let</code> 區塊本身,也包括其內部的區塊,除非內部區塊定義了相同名稱的變數。</p>
+
+<h3 id="let_表達式" name="let_表達式"><code>let</code> 表達式</h3>
+
+<div class="warning">
+<p>The <code>let</code> block and <code>let</code> expression syntax is non-standard and will be removed in the future. Do not use them! See {{bug(1023609)}} for more details.</p>
+</div>
+
+<p>你可以使用 <code>let</code> 來確立只對單一表達式有效的變數:</p>
+
+<pre class="brush: js">var x = 5;
+var y = 0;
+document.write( let(x = x + 10, y = 12) x+y + "&lt;BR&gt;\n");
+document.write(x+y + "&lt;BR&gt;\n");
+</pre>
+
+<p>結果為:</p>
+
+<pre>27
+5
+</pre>
+
+<p>在這個例子中,將 <var>x </var>和 y 指定為 <code>x+10</code> 和 <code>12</code> 只對 <code>x+y</code> 這個表達式有效。</p>
+
+<h4 id="作用域規則" name="作用域規則">作用域規則</h4>
+
+<p>假設有一個 <code>let</code> 表示式:</p>
+
+<pre class="eval">let (<var>decls</var>) <var>expr</var>
+</pre>
+
+<p>這裡的 <var>expr</var> 也會被隱含的區塊所包圍。</p>
+
+<h3 id="let_定義" name="let_定義"><code>let</code> 定義</h3>
+
+<p><code>let</code> 關鍵字也可以用來定義在區塊中的變數。</p>
+
+<div class="note"><strong>附註:</strong> 如果你有更多有趣的例子是有關於 <code>let</code> 定義的使用方式,可以考慮加到此處。</div>
+
+<pre class="brush: js">if (x &gt; y) {
+ let gamma = 12.7 + y;
+ i = gamma * x;
+}</pre>
+
+<p>你可以在擴充套件的代碼中使用 <code>let</code> 定義假命名空間的別名。(詳見 <a href="/zh_tw/擴充套件中安全性的最佳實踐" title="zh tw/擴充套件中安全性的最佳實踐">擴充套件中安全性的最佳實踐</a>。)</p>
+
+<pre class="brush: js">let Cc = Components.classes, Ci = Components.interfaces;
+</pre>
+
+<p>當使用到內部函數的時候,有時 <code>let</code> 語法、表達式和定義可使代碼更為簡潔。</p>
+
+<pre class="brush: js">var list = document.getElementById("list");
+
+for (var i = 1; i &lt;= 5; i++) {
+  var item = document.createElement("LI");
+  item.appendChild(document.createTextNode("Item " + i));
+
+  let j = i;
+  item.onclick = function (ev) {
+    alert("Item " + j + " is clicked.");
+  };
+  list.appendChild(item);
+}
+</pre>
+
+<p>上面的例子有意如此運作,五個(匿名)內部函數的實體分別參考到五個不同變數 <code>j</code> 的實體。注意,如果你改用 <code>var</code> 取代 <code>let</code>,或是移除變數 <code>j</code> 並簡單的在內部函數中使用變數 <code>i</code>,他就不再如此運作。</p>
+
+<h4 id="作用域規則" name="作用域規則">作用域規則</h4>
+
+<p>使用 <code>let</code> 宣告的變數其作用域不僅是限於所在的區塊,也可用於所在區塊的任意子區塊之中,只要這些子區塊未再次定義同樣的變數。在這個方式下,<code>let</code> 的運作就非常類似 <code>var</code>。主要的不同點在於 <code>var</code> 變數的作用域的範圍是整塊函數︰</p>
+
+<pre class="brush: js"> function varTest() {
+ var x = 31;
+ if (true) {
+ var x = 71; // 相同的變數!
+ alert(x); // 71
+ }
+ alert(x); // 71
+ }
+
+ function letTest() {
+ let x = 31;
+ if (true) {
+ let x = 71; // 不同的變數
+ alert(x); // 71
+ }
+ alert(x); // 31
+ }
+</pre>
+
+<p><code>=</code> 右邊的表達式受限於區塊的內部。和 <code>let</code> 表達式 以及 <code>let</code> 語法 的作用範圍不同︰</p>
+
+<pre class="brush: js"> function letTests() {
+ let x = 10;
+
+ // let 語法
+ let (x = x + 20) {
+ alert(x); // 30
+ }
+
+ // let 表達式
+ alert(let (x = x + 20) x); // 30
+
+ // let 定義
+ {
+ let x = x + 20; // 此處的 x 會被求值成 undefined
+ alert(x); // undefined + 20 ==&gt; NaN
+ }
+ }
+</pre>
+
+<p>在程式或類別中,<code>let</code> 並不會像 <code>var</code> 那樣在全域物件上建立屬性;取而代之的是,在對某個內容的語句求值之際,隱含的區塊會被建立,<code>let</code> 便會在隱含的區塊中建立屬性。其本質上的意義是 <code>let</code> 並不會覆蓋先前使用 <code>var</code> 定義的變數。例如︰</p>
+
+<pre class="brush: js">var x = 'global';
+let x = 42;
+document.write(this.x + "&lt;br&gt;\n");
+</pre>
+
+<p>代碼所顯示的輸出將會是 "global" 而非 "42"。</p>
+
+<p><span style="color: rgb(0, 0, 255);">隱含的區塊</span>並不使用圓括弧來界定,他是由 JavaScript 引擎暗中建立的。</p>
+
+<p>在函數中,以 <code>eval()</code> 執行的 <code>let</code> 並不像 <code>var</code> 那樣在變數物件上(活動中的物件或最內部的區塊)建立屬性;取而代之的是,在對程式中的語句求值之際,隱含的區塊會被建立,<code>let</code> 便會在隱含的區塊中建立屬性。這是 <code>eval()</code> 在程式上以前述規則作用的結果。</p>
+
+<p>換句話說,當你使用 <code>eval()</code> 來執行代碼的時候,這些代碼會被視為獨立的程式,這些程式的代碼會被隱含的區塊所包圍。</p>
+
+<h3 id="for_迴圈裡加上_let_的變數" name="for_迴圈裡加上_let_的變數"><code>for</code> 迴圈裡加上 <code>let</code> 的變數</h3>
+
+<p>你可以使用 <code>let</code> 關鍵字把局域變數限制在 <code>for</code> 迴圈的作用域裡,就像使用 <code>var</code> 一般。</p>
+
+<pre class="brush: js">** 加入 obj **
+ var i=0;
+ for ( let i=i ; i &lt; 10 ; i++ )
+ document.write(i + "&lt;BR&gt;\n");
+
+ for ( let [name,value] in obj )
+ document.write("名稱: " + name + ", 值: " + value + "&lt;BR&gt;\n");
+</pre>
+
+<h4 id="作用域規則" name="作用域規則">作用域規則</h4>
+
+<pre class="eval">for (let <var>expr1</var>; <var>expr2</var>; <var>expr3</var>) <var>statement</var>
+</pre>
+
+<p>在本例中,<var>expr2</var>、<var>expr3</var>、<var>statement</var> 都會被含括在隱含的區塊裡,而這個區塊裡內含以 <code>let <var>expr1</var></code> 宣告的區塊局域變數。這是前述的第一個迴圈的示例。</p>
+
+<pre class="eval">for (let <var>expr1</var> in <var>expr2</var>) <var>statement</var>
+for each(let <var>expr1</var> in <var>expr2</var>) <var>statement</var>
+</pre>
+
+<p>這兩種情況都會有一個內含每一個 <var>statement</var> 的隱含區塊。其中第一個是前述的第二個迴圈。</p>
+
+<h2 id="分割代入" name="分割代入">分割代入</h2>
+
+<p>分割代入是利用反映出陣列或物件結構的字面表達的語法,從陣列或物件抽取資料。</p>
+
+<p>陣列或物件的字面表達式可提供簡易的方式來建立特用的資料封包。這些資料封包一經建立之後,就能以任意方式來做想做的事。你甚至可以從函數裡返回這些資料封包。</p>
+
+<p>分割代入其中一件特別實用的用法是以單一的語句讀取整個結構,不過還有很多有趣的使用方式,並會在隨後小節中顯示完整的範例。</p>
+
+<p>這種能力很類似 Perl 或 Python 等語言所具有的機能。</p>
+
+<h3 id="範例" name="範例">範例</h3>
+
+<p>分割代入最好的解釋方式就是使用範例,所以這裡有一些可供你閱讀並從中學習。</p>
+
+<h4 id="避免臨時變數" name="避免臨時變數">避免臨時變數</h4>
+
+<p>你可以使用分割代入交換變數值,例如︰</p>
+
+<pre class="brush: js">var a = 1;
+var b = 3;
+
+[a, b] = [b, a];
+</pre>
+
+<p>執行代碼之後,<var>b</var> 變成 1 且 <var>a</var> 變成 3。如果沒有分割代入,就需要臨時變數交換兩個變數值(在某些低階語言中,可以使用 <a class="external" href="http://en.wikipedia.org/wiki/XOR_swap">XOR-交換技巧</a>)。</p>
+
+<p>同樣的,也可以用來交換三個以上的變數︰</p>
+
+<pre class="brush: js">var a = 'o';
+var b = "&lt;font color = 'green'&gt;o&lt;/font&gt;";
+var c = 'o';
+var d = 'o';
+var e = 'o';
+var f = "&lt;font color = 'blue'&gt;o&lt;/font&gt;";
+var g = 'o';
+var h = 'o';
+
+for (lp=0;lp&lt;40;lp++)
+ {[a, b, c, d, e, f, g, h] = [b, c, d, e, f, g, h, a];
+ document.write(a+''+b+''+c+''+d+''+e+''+f+''+g+''+h+''+"&lt;br /&gt;");}
+</pre>
+
+<p>執行代碼時,就會顯示變動的色彩循環效果。</p>
+
+<p>回到我們先前費伯納契數產生器的範例,我們可以去掉臨時變數 "t",改在單一的群組代入語法中計算 "i" 和 "j" 的新值︰</p>
+
+<pre class="brush: js">function fib() {
+ var i = 0, j = 1;
+ while (true) {
+ yield i;
+ [i, j] = [j, i + j];
+ }
+}
+
+var g = fib();
+for (let i = 0; i &lt; 10; i++)
+ print(g.next());
+</pre>
+
+<h4 id="返回多重值" name="返回多重值">返回多重值</h4>
+
+<p>感謝有了分割代入,函數因此能夠返回多重值。儘管一直都可以從函數返回陣列,不過分割代入可提供更進一步的靈活性。</p>
+
+<pre class="brush: js">function f() {
+ return [1, 2];
+}
+</pre>
+
+<p>如你所見,返回值是以類似陣列的記法把所有要返回的值含括在方括號內來完成的。你可以使用這個方式來返回任意數目的結果。在本例中,<code>f()</code> 返回變數 <code>{{ mediawiki.external('1, 2') }}</code> 作為他的輸出。</p>
+
+<pre class="brush: js">var a, b;
+[a, b] = f();
+document.write ("A is " + a + " B is " + b + "&lt;BR&gt;\n");
+</pre>
+
+<p>指令 <code>{{ mediawiki.external('a, b') }} = f()</code> 會把函數返回的結果依序代入到方括號裡的變數︰<var>a</var> 會被設成 1 而 <var>b</var> 會被設成 2。</p>
+
+<p>你也可以如同陣列一般取回返回值︰</p>
+
+<pre class="brush: js">var a = f();
+document.write ("A is " + a);
+</pre>
+
+<p>在本例中,<var>a</var> 是內含有值 1 和值 2 的陣列。</p>
+
+<h4 id="在物件上循環" name="在物件上循環">在物件上循環</h4>
+
+<p>你也可以使用分割代入從物件取出資料︰</p>
+
+<pre class="brush: js">var obj = { width: 3, length: 1.5, color: "orange" };
+
+for (let[name, value] in obj) {
+ document.write ("Name: " + name + ", Value: " + value + "&lt;BR&gt;\n");
+}
+</pre>
+
+<p>這個循環會遍歷 <var>obj</var> 物件所有的鍵值對,並顯示這些鍵值對的名稱和值。在本例中,其輸出如下︰</p>
+
+<pre>Name: width, Value: 3
+Name: length, Value: 1.5
+Name: color, Value: orange
+</pre>
+
+<p>在 JavaScript 1.7 中,圍繞著 <code>obj</code> 的 <code>Iterator()</code> 並不是必要的;不過在 <a href="/zh_tw/JavaScript_1.8_新鮮事" title="zh tw/JavaScript 1.8 新鮮事">JavaScript 1.8</a> 則是必要的。這是為了使分割代入可用於陣列(詳見 {{ Bug(366941) }})。</p>
+
+<h4 id="在物件的陣列中的值上循環" name="在物件的陣列中的值上循環">在物件的陣列中的值上循環</h4>
+
+<p>你可以遍歷物件上的陣列,在每一個物件上取出感興趣的資料欄位︰</p>
+
+<pre class="brush: js">var people = [
+ {
+ name: "Mike Smith",
+ family: {
+ mother: "Jane Smith",
+ father: "Harry Smith",
+ sister: "Samantha Smith"
+ },
+ age: 35
+ },
+ {
+ name: "Tom Jones",
+ family: {
+ mother: "Norah Jones",
+ father: "Richard Jones",
+ brother: "Howard Jones"
+ },
+ age: 25
+ }
+];
+
+for each (let {name: n, family: { father: f } } in people) {
+ document.write ("Name: " + n + ", Father: " + f + "&lt;BR&gt;\n");
+}
+</pre>
+
+<p>本例會取出 <var>name</var> 和 <var>family.father</var> 欄位,存在 <var>n</var> 和 <var>f</var> 裡,並輸出其內容。這會對 <var>people</var> 陣列裡的每一個物件進行處理。其輸出如下︰</p>
+
+<pre>Name: Mike Smith, Father: Harry Smith
+Name: Tom Jones, Father: Richard Jones
+</pre>
+
+<h4 id="忽略部分返回值" name="忽略部分返回值">忽略部分返回值</h4>
+
+<p>你也可以忽略不想要的返回值︰</p>
+
+<pre class="brush: js">function f() {
+ return [1, 2, 3];
+}
+
+var [a, , b] = f();
+document.write ("A is " + a + " B is " + b + "&lt;BR&gt;\n");
+</pre>
+
+<p>執行這個代碼之後,a 變成 1 而 b 變成 3。值 2 會被忽略。你可以按這個方式忽略任意(或全部)的返回值。例如︰</p>
+
+<pre class="brush: js">[,,,] = f();
+</pre>
+
+<h4 id="從正規表達式的比對結果取值" name="從正規表達式的比對結果取值">從正規表達式的比對結果取值</h4>
+
+<p>當正規表達式的 <code><a href="/zh_tw/Core_JavaScript_1.5_參考/全域物件/RegExp/exec" title="zh tw/Core JavaScript 1.5 參考/全域物件/RegExp/exec">exec()</a></code> 方法找到符合結果時,就會返回比對結果的陣列。其中第一項是要比對的完整字串,之後是符合正規表達式中的每一個圓括弧的子字串。分割代入可讓你更簡單的從陣列中取出一部分資料,忽略不需要的比對結果。</p>
+
+<pre class="brush: js">// 使用簡單的正規表達式比對 http / https / ftp 形式的 URL。
+var parsedURL = /^(\w+)\:\/\/([^\/]+)\/(.*)$/.exec(url);
+if (!parsedURL)
+ return null;
+var [, protocol, fullhost, fullpath] = parsedURL;
+</pre>
+
+<p>{{ languages( { "en": "en/New_in_JavaScript_1.7", "es": "es/Novedades_en_JavaScript_1.7", "fr": "fr/Nouveaut\u00e9s_dans_JavaScript_1.7", "it": "it/Novit\u00e0_in_JavaScript_1.7", "ja": "ja/New_in_JavaScript_1.7", "pl": "pl/Nowo\u015bci_w_JavaScript_1.7" } ) }}</p>
diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.8.1/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.8.1/index.html
new file mode 100644
index 0000000000..699ff53f02
--- /dev/null
+++ b/files/zh-tw/web/javascript/new_in_javascript/1.8.1/index.html
@@ -0,0 +1,41 @@
+---
+title: JavaScript 1.8.1 新鮮事
+slug: Web/JavaScript/New_in_JavaScript/1.8.1
+tags:
+ - ECMAScript5
+ - Firefox 3.5
+ - Gecko 1.9.1
+ - JavaScript
+ - JavaScript 1.8.1
+ - JavaScript_version_overviews
+translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.8.1
+---
+<div>{{jsSidebar("New_in_JS")}}</div>
+<div>
+<p>{{ gecko_minversion_header("1.9.1") }}</p>
+
+<p>  JavaScript 1.8.1 僅只修改了一小部份語法。主要的改變可以看 <a class="internal" href="/En/SpiderMonkey/Internals/Tracing_JIT" title="En/SpiderMonkey/Internals/Tracing JIT">Tracemonkey just-in-time compiler</a>,大多是關於效能增進的部份。</p>
+
+<p>  以下列舉一些值得注意的 API 變動 (細節詳見 <a class="external" href="http://groups.google.com/group/mozilla.dev.tech.js-engine/browse_thread/thread/a4d1fe147761aacb#" title="http://groups.google.com/group/mozilla.dev.tech.js-engine/browse_thread/thread/a4d1fe147761aacb#">detailed in this newsgroup posting</a>):</p>
+
+<h2 id="語言新增">語言新增</h2>
+
+<dl>
+ <dt><a class="internal" href="../../../../En/Core_JavaScript_1.5_Reference/Global_Objects/Object/GetPrototypeOf" rel="internal"><code>Object.getPrototypeOf()</code></a></dt>
+ <dd>這個新函式可以回傳物件的 prototype。</dd>
+ <dt><a class="internal" href="/En/Using_native_JSON" title="En/Using JSON in Firefox">Using native JSON</a></dt>
+ <dd>Firefox 3.5 可以原生支援 <a class="internal" href="/en/JSON" title="En/JSON">JSON</a> 的操作了。</dd>
+ <dt>增加了新的 trim 函式到 String 物件</dt>
+ <dd>現在 <a class="internal" href="../../../../en/Core_JavaScript_1.5_Reference/Global_Objects/String" rel="internal"><code>String</code></a> 物件擁有 <a class="internal" href="../../../../En/Core_JavaScript_1.5_Reference/Global_Objects/String/Trim" rel="internal"><code>trim()</code></a>, <code><a class="internal" href="../../../../En/Core_JavaScript_1.5_Reference/Global_Objects/String/TrimLeft" rel="internal">trimLeft()</a> 和</code> <a class="internal" href="../../../../En/Core_JavaScript_1.5_Reference/Global_Objects/String/TrimRight" rel="internal"><code>trimRight()</code></a> 函式。</dd>
+</dl>
+
+<h2 id="其他改良">其他改良</h2>
+
+<ul>
+ <li>Implicit setting of properties in object and array initializers no longer execute setters in JavaScript. This makes the behavior of setting the values of properties more predictable. See the blog post <a class="external" href="/web-tech/2009/04/29/object-and-array-initializers-should-not-invoke-setters-when-evaluated" title="https://developer.mozilla.org/editor/fckeditor/core/editor/web-tech/2009/04/29/object-and-array-initializers-should-not-invoke-setters-when-evaluated/">Object and array initializers should not invoke setters when evaluated</a> for details.</li>
+</ul>
+
+<p>{{ languages( { "ja": "ja/New_in_JavaScript_1.8.1"} ) }}</p>
+</div>
+
+<p> </p>
diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.8.5/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.8.5/index.html
new file mode 100644
index 0000000000..3515191b8b
--- /dev/null
+++ b/files/zh-tw/web/javascript/new_in_javascript/1.8.5/index.html
@@ -0,0 +1,132 @@
+---
+title: New in JavaScript 1.8.5
+slug: Web/JavaScript/New_in_JavaScript/1.8.5
+tags:
+ - ECMAScript5
+ - JavaScript
+ - JavaScript 1.8.5
+translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.8.5
+---
+<div>{{jsSidebar("New_in_JS")}}</div>
+
+<p>以下為 JavaScript 1.8.5 的更新日誌,此版本被涵蓋於 <a href="/zh-TW/Firefox/Releases/4">Firefox 4</a> 之中。</p>
+
+<h2 id="JavaScript_1.8.5_新功能">JavaScript 1.8.5 新功能</h2>
+
+<h3 id="新函數">新函數</h3>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">函數</th>
+ <th scope="col">敘述</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{jsxref("Object.create()")}}</td>
+ <td>
+ <p>基於一個特定的原型物件和屬性,建立一個新物件。{{bug("492840")}}</p>
+ </td>
+ </tr>
+ <tr>
+ <td>{{jsxref("Object.defineProperty()")}}</td>
+ <td>Adds the named property described by a given descriptor to an object.</td>
+ </tr>
+ <tr>
+ <td>{{jsxref("Object.defineProperties()")}}</td>
+ <td>Adds the named properties described by the given descriptors to an object.</td>
+ </tr>
+ <tr>
+ <td>{{jsxref("Object.getOwnPropertyDescriptor()")}}</td>
+ <td>Returns a property descriptor for a named property on an object. {{bug("505587")}}</td>
+ </tr>
+ <tr>
+ <td>{{jsxref("Object.keys()")}}</td>
+ <td>Returns an array of all enumerable properties on an object. {{bug("307791")}}</td>
+ </tr>
+ <tr>
+ <td>{{jsxref("Object.getOwnPropertyNames()")}}</td>
+ <td>Returns an array of all enumerable and non-enumerable properties on an object. {{bug("518663")}}</td>
+ </tr>
+ <tr>
+ <td>{{jsxref("Object.preventExtensions()")}}</td>
+ <td>Prevents any extensions of an object. {{bug("492849")}}</td>
+ </tr>
+ <tr>
+ <td>{{jsxref("Object.isExtensible()")}}</td>
+ <td>Determine if extending of an object is allowed. {{bug("492849")}}</td>
+ </tr>
+ <tr>
+ <td>{{jsxref("Object.seal()")}}</td>
+ <td>
+ <p>避免其他程式碼刪除一個物件的屬性。 {{bug("492845")}}</p>
+ </td>
+ </tr>
+ <tr>
+ <td>{{jsxref("Object.isSealed()")}}</td>
+ <td>Determine if an object is sealed. {{bug("492845")}}</td>
+ </tr>
+ <tr>
+ <td>{{jsxref("Object.freeze()")}}</td>
+ <td>凍結一個物件:其他程式碼無法刪除或更便任何屬性。{{bug("492844")}}</td>
+ </tr>
+ <tr>
+ <td>{{jsxref("Object.isFrozen()")}}</td>
+ <td>辨識一個物件是否遭凍結。{{bug("492844")}}</td>
+ </tr>
+ <tr>
+ <td>{{jsxref("Array.isArray()")}}</td>
+ <td>檢查一個變數是否為陣列。{{bug("510537")}}</td>
+ </tr>
+ <tr>
+ <td>{{jsxref("Date.prototype.toJSON()")}}</td>
+ <td>回傳一個 JSON 格式的字串 給<code>Date</code> 物件。</td>
+ </tr>
+ <tr>
+ <td>{{jsxref("Function.prototype.bind()")}}</td>
+ <td>
+ <p>Creates a new function that, when called, itself calls this function in the context provided (with a given sequence of arguments) {{bug("429507")}}</p>
+ </td>
+ </tr>
+ </tbody>
+</table>
+
+<h3 id="New_ECMAScript5_features">New ECMAScript5 features</h3>
+
+<ul>
+ <li><code><a href="/zh-TW/docs/Web/JavaScript/Reference/Operators/get" title="JavaScript/Reference/Operators/Special Operators/get Operator">get</a></code> and <code><a href="/zh-TW/docs/Web/JavaScript/Reference/Operators/set" title="JavaScript/Reference/Operators/Special Operators/set Operator">set</a></code> operators now allows the identifier to be numeric or a string. {{bug("520696")}}</li>
+ <li>{{jsxref("Function.apply()")}} can accept any array-like object as the arguments list, instead of only true arrays.</li>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode" title="JavaScript/Strict mode">strict mode support</a></li>
+ <li>{{jsxref("Array.toString()")}} now works even on non-arrays by either returning the result of calling its <a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Array/join" title="JavaScript/Reference/Global Objects/Array/join"><code>join()</code></a> method if one is available or by calling its <a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Object/toString" title="JavaScript/Reference/Global Objects/Object/toString"><code>toString()</code></a> method.</li>
+</ul>
+
+<h3 id="Other_standardization_work">Other standardization work</h3>
+
+<p>Various non-standard syntaxes for defining getters and setters have been removed; ECMAScript 5 defined syntax has not been changed. These were all pretty esoteric and rarely used; if this affects you, see <a class="external" href="http://whereswalden.com/2010/04/16/more-spidermonkey-changes-ancient-esoteric-very-rarely-used-syntax-for-creating-getters-and-setters-is-being-removed/" title="http://whereswalden.com/2010/04/16/more-spidermonkey-changes-ancient-esoteric-very-rarely-used-syntax-for-creating-getters-and-setters-is-being-removed/">this blog post</a> for details.</p>
+
+<h3 id="新物件">新物件</h3>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Object</th>
+ <th scope="col">Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{jsxref("Proxy")}}</td>
+ <td>Offers support for creating <code>Object</code> and <code>Function</code> proxies that enable meta-programming in JavaScript.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Changed_functionality_in_JavaScript_1.8.5">Changed functionality in JavaScript 1.8.5</h2>
+
+<ul>
+ <li>ISO 8601 support in <code>Date</code>: The {{jsxref("Date")}} object's <a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Date/parse" title="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/parse">parse()</a> method now supports simple ISO 8601 format date strings.</li>
+ <li>Global objects made read only: The <a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/NaN" title="JavaScript/Reference/Global Objects/NaN"><code>NaN</code></a>, <a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Infinity" title="JavaScript/Reference/Global Objects/Infinity"><code>Infinity</code></a>, and <a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/undefined" title="JavaScript/Reference/Global Objects/undefined"><code>undefined</code></a> global objects have been made read only, per the ECMAScript 5 specification.</li>
+ <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Object/Parent" title="JavaScript/Reference/Global Objects/Object/Parent"><code>obj.__parent__</code></a> and <code>obj.__count__</code> become obsolete. Some information about why: <a class="external" href="http://whereswalden.com/2010/05/07/spidermonkey-change-du-jour-the-special-__parent__-property-has-been-removed/" title="http://whereswalden.com/2010/05/07/spidermonkey-change-du-jour-the-special-__parent__-property-has-been-removed/">SpiderMonkey change du jour: the special __parent__ property has been removed</a> {{bug("551529")}} &amp; {{bug("552560")}}.</li>
+ <li>Trailing commas no longer accepted in {{jsxref("JSON.parse()")}}.</li>
+</ul>
diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.8/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.8/index.html
new file mode 100644
index 0000000000..63ab0e81b0
--- /dev/null
+++ b/files/zh-tw/web/javascript/new_in_javascript/1.8/index.html
@@ -0,0 +1,125 @@
+---
+title: JavaScript 1.8 新鮮事
+slug: Web/JavaScript/New_in_JavaScript/1.8
+tags:
+ - JavaScript
+ - JavaScript_version_overviews
+translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.8
+---
+<div>{{jsSidebar("New_in_JS")}}</div>
+<p>{{ Fx_minversion_header(3) }} JavaScript 1.8 是 Gecko 1.9(包含於 <a href="/zh_tw/Firefox_3_技術文件" title="zh tw/Firefox 3 技術文件">Firefox 3</a>)的一部分。相較於 <a href="/zh_tw/JavaScript_1.7_新鮮事" title="zh tw/JavaScript 1.7 新鮮事">JavaScript 1.7</a> 此版只是個小更新,不過部分更新是為了跟進 ECMAScript 4/JavaScript 2。此次的釋出版本包含所有在 <a href="/zh_tw/JavaScript_1.6_新鮮事" title="zh tw/JavaScript 1.6 新鮮事">JavaScript 1.6</a> 和 <a href="/zh_tw/JavaScript_1.7_新鮮事" title="zh tw/JavaScript 1.7 新鮮事">JavaScript 1.7</a> 出現的新機能。</p>
+
+<p>詳見 {{ Bug(380236) }} 以追蹤 JavaScript 1.8 的開發狀態。本文件的狀態可見 {{ Bug(421027) }}。</p>
+
+<h3 id="使用_JavaScript_1.8" name="使用_JavaScript_1.8">使用 JavaScript 1.8</h3>
+
+<p>為了在 HTML 中使用 JavaScript 1.8 的新機能,需要像下面那樣來使用︰</p>
+
+<pre class="brush: js"> &lt;script type="application/javascript;version=1.8"&gt; ... 你的代碼 ... &lt;/script&gt;
+</pre>
+
+<p>另一個方式(不推薦)是使用已廢棄的 <code>&lt;script&gt;</code> 語言屬性並把他定義為 "JavaScript1.8"。</p>
+
+<p>如果是使用 <a href="/zh_tw/SpiderMonkey/JavaScript_shell_入門" title="zh tw/SpiderMonkey/JavaScript shell 入門">JavaScript shell</a>,JavaScript XPCOM 元件,或 XUL <code>&lt;script&gt;</code> 元件,會自動({{ Bug(381031) }}, {{ Bug(385159) }})使用最新的 JS 版本(在 Mozilla 1.9 中是 JS1.8)。</p>
+
+<p>如果某一機能需要使用到新關鍵字 "yield" 和 "let",你就要指定 1.7 以上的版本,因為現存的代碼可能會使用這些關鍵字作為變數或函數名。至於未使用到新關鍵字的機能(例如產生器表達式)可以直接使用,不需指定 JavaScript 版本。</p>
+
+<h3 id="表達式化簡" name="表達式化簡">表達式化簡</h3>
+
+<p>表達式化簡(Expression closures)提供類似 典型 <a class="external" href="http://en.wikipedia.org/wiki/Lambda_calculus#Lambda_calculus_and_programming_languages">Lambda 記法</a> 的語法,除了用於簡單函數的簡寫以外,並未帶來其他新機能。</p>
+
+<p><a href="/zh_tw/JavaScript_1.7_新鮮事" title="zh tw/JavaScript 1.7 新鮮事">JavaScript 1.7</a> 及早期版本︰</p>
+
+<pre class="brush: js"> function(x) { return x * x; }
+</pre>
+
+<p>JavaScript 1.8︰</p>
+
+<pre class="brush: js"> function(x) x * x
+</pre>
+
+<p>這個語法可讓你省略花括弧和 'return' 語法 - 使這些隱含化。以這種風格編寫的代碼除了簡短以外,並沒有其他額外的優點。</p>
+
+<p><strong>範例:</strong></p>
+
+<p>連結事件接收器的簡寫︰</p>
+
+<pre class="brush: js"> document.addEventListener("click", function() false, true);
+</pre>
+
+<p>在來自 <a href="/zh_tw/JavaScript_1.6_新鮮事" title="zh tw/JavaScript 1.6 新鮮事">JavaScript 1.6</a> 的 some 中使用這個記法︰</p>
+
+<pre class="brush: js"> elems.some(function(elem) elem.type == "text");
+</pre>
+
+<h3 id="產生器表達式" name="產生器表達式">產生器表達式</h3>
+
+<p>This addition allows you to simply create generators (which were introduced in <a href="/en/New_in_JavaScript_1.7" title="en/New_in_JavaScript_1.7">JavaScript 1.7</a>). Typically you would have to create a custom function which would have a yield in it, but this addition allows you to use array comprehension-like syntax to create an identical generator statement.</p>
+
+<p>In <a href="/en/New_in_JavaScript_1.7" title="en/New_in_JavaScript_1.7">JavaScript 1.7</a>, you might write something like the following in order to create a custom generator for an object:</p>
+
+<pre class="brush: js"> function add3(obj) {
+ for ( let i in obj )
+ yield i + 3;
+ }
+
+ let it = add3(someObj);
+ try {
+ while (true) {
+ document.write(it.next() + "&lt;br&gt;\n");
+ }
+ } catch (err if err instanceof StopIteration) {
+ document.write("End of record.&lt;br&gt;\n");
+ }
+</pre>
+
+<p>In JavaScript 1.8, you can circumvent having to create a custom generator function by using a generator expression instead:</p>
+
+<pre class="brush: js"> let it = (i + 3 for (i in someObj));
+ try {
+ while (true) {
+ document.write(it.next() + "&lt;br&gt;\n");
+ }
+ } catch (err if err instanceof StopIteration) {
+ document.write("End of record.&lt;br&gt;\n");
+ }
+</pre>
+
+<p>Generator expressions can also be passed in, as values, to a function. This is particularly noteworthy since generators aren't run until they are absolutely needed (unlike for typical array comprehension situations, where the arrays are constructed ahead of time). An example of the difference can be seen here:</p>
+
+<p>Using JavaScript 1.7 Array Comprehension</p>
+
+<pre class="brush: js"> handleResults([ i for ( i in obj ) if ( i &gt; 3 ) ]);
+
+ function handleResults( results ) {
+ for ( let i in results )
+ // ...
+ }
+</pre>
+
+<p>Using JavaScript 1.8 Generator Expressions</p>
+
+<pre class="brush: js"> handleResults( i for ( i in obj ) if ( i &gt; 3 ) );
+
+ function handleResults( results ) {
+ for ( let i in results )
+ // ...
+ }
+</pre>
+
+<p>The significant difference between the two examples being that by using the generator expressions, you would only have to loop over the 'obj' structure once, total, as opposed to once when comprehending the array, and again when iterating through it.</p>
+
+<h3 id="陣列更進一步的擴充" name="陣列更進一步的擴充">陣列更進一步的擴充</h3>
+
+<p>There are two new iterative <code><a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Array" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code> methods included in JavaScript 1.8, specifically:</p>
+
+<ul>
+ <li><code><a href="/En/Core_JavaScript_1.5_Reference/Global_Objects/Array/Reduce" title="en/Core_JavaScript_1.5_Reference/Objects/Array/reduce">reduce()</a></code> - runs a function on every item in the array and collects the results from previous calls.</li>
+ <li><code><a href="/En/Core_JavaScript_1.5_Reference/Global_Objects/Array/ReduceRight" title="en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight">reduceRight()</a></code> - runs a function on every item in the array and collects the results from previous calls, but in reverse.</li>
+</ul>
+
+<h3 id="for..in_分割代入的變更" name="for..in_分割代入的變更">for..in 分割代入的變更</h3>
+
+<p>One change that occurred in the release of JavaScript 1.8 was a bug fix related to the key/value <a class="internal" href="/en/New_in_JavaScript_1.7" title="En/New in JavaScript 1.7">destructuring of arrays</a> introduced in JavaScript 1.7. Previously it was possible to destructure the keys/values of an array by using for ( var [key, value] in array ). However that made it impossible to destructure the values of an array - that were arrays. This has been resolved now. ({{ Bug(366941) }}).</p>
+
+<p>{{ languages( { "en": "en/New_in_JavaScript_1.8", "es": "es/Novedades_en_JavaScript_1.8", "fr": "fr/Nouveaut\u00e9s_dans_JavaScript_1.8", "ja": "ja/New_in_JavaScript_1.8", "pl": "pl/Nowo\u015bci_w_JavaScript_1.8", "pt": "pt/Novidades_no_Javascript_1.8", "ko": "ko/New_in_JavaScript_1.8" } ) }}</p>
diff --git a/files/zh-tw/web/javascript/new_in_javascript/index.html b/files/zh-tw/web/javascript/new_in_javascript/index.html
new file mode 100644
index 0000000000..0dd24e1d1d
--- /dev/null
+++ b/files/zh-tw/web/javascript/new_in_javascript/index.html
@@ -0,0 +1,71 @@
+---
+title: JavaScript 新鮮事
+slug: Web/JavaScript/New_in_JavaScript
+tags:
+ - NeedsTranslation
+ - TopicStub
+translation_of: Archive/Web/JavaScript/New_in_JavaScript
+---
+<div>{{jsSidebar("New_in_JS")}}</div>
+
+<p>This chapter contains information about JavaScript's version history and implementation status for Mozilla/SpiderMonkey-based JavaScript applications, such as Firefox.</p>
+
+<h2 id="ECMAScript_versions">ECMAScript versions</h2>
+
+<dl>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/Language_Resources">Language resources</a></dt>
+ <dd>Learn more about the ECMAScript standards on which the JavaScript language is based on.</dd>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_5_support_in_Mozilla">ECMAScript 5 support</a></dt>
+ <dd>Implementation status for the current standard ECMA-262 Edition 5.1 in Mozilla-based engines and products.</dd>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla">ECMAScript 2015 support</a></dt>
+ <dd>Implementation status for the draft ECMA-262 Edition 6 (ES2015 or ES6) in Mozilla-based engines and products.</dd>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_Next_support_in_Mozilla">ECMAScript Next support</a></dt>
+ <dd>Implementation status for upcoming ECMA-262 features as per the yearly (ES2016/ES2017/ES2018/...) release schedule in Mozilla-based engines and products.</dd>
+</dl>
+
+<h2 id="JavaScript_release_notes">JavaScript release notes</h2>
+
+<dl>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/New_in_JavaScript/Firefox_JavaScript_changelog">Firefox JavaScript changelog</a></dt>
+ <dd>See this changelog for JavaScript features implemented in Firefox 5 and later.</dd>
+</dl>
+
+<h2 id="JavaScript_versions">JavaScript versions</h2>
+
+<p><strong>Deprecated</strong> ({{deprecated_inline}}). The explicit versioning and opt-in of language features was Mozilla-specific and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=867609">is in process of being removed</a>. Firefox 4 was the last version which referred to an JavaScript version (1.8.5). With new ECMA standards, JavaScript language features are now often mentioned with their initial definition in ECMA-262 Editions such as Edition 6 (ES2015/ES6).</p>
+
+<p>JavaScript was released as version 1.0 in March 1996 in Netscape Navigator 2.0 and Internet Explorer 2.0.</p>
+
+<dl>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/New_in_JavaScript/1.1">JavaScript 1.1</a></dt>
+ <dd>Version shipped in Netscape Navigator 3.0. Released on August 19, 1996.</dd>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/New_in_JavaScript/1.2">JavaScript 1.2</a></dt>
+ <dd>Version shipped in Netscape Navigator 4.0-4.05. Released on June 11, 1997.</dd>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/New_in_JavaScript/1.3">JavaScript 1.3</a></dt>
+ <dd>Version shipped in Netscape Navigator 4.06-4.7x. Released on October 19, 1998.<br>
+ Standardization work to be compliant with ECMA-262 1st and 2nd Edition.</dd>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/New_in_JavaScript/1.4">JavaScript 1.4</a></dt>
+ <dd>Version shipped in Netscape's server side JavaScript. Released in 1999.</dd>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/New_in_JavaScript/1.5">JavaScript 1.5</a></dt>
+ <dd>Version shipped in Netscape Navigator 6.0 and Firefox 1.0. Release on November 14, 2000.<br>
+ Standardization work to be compliant with ECMA-262 3rd Edition.</dd>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/New_in_JavaScript/1.6">JavaScript 1.6</a></dt>
+ <dd>Version shipped in Firefox 1.5. Released in November 2005.<br>
+ Includes ECMAScript for XML (E4X), new <code>Array</code> methods plus <code>String</code> and <code>Array</code> generics.</dd>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/New_in_JavaScript/1.7">JavaScript 1.7</a></dt>
+ <dd>Version shipped in Firefox 2. Released in October 2006.<br>
+ Includes generators, iterators, array comprehensions, <code>let</code> expressions, and destructuring assignment.</dd>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/New_in_JavaScript/1.8">JavaScript 1.8</a></dt>
+ <dd>Version shipped in Firefox 3. Released in June 2008.<br>
+ Includes expression closures, generator expressions and <code>Array.reduce()</code></dd>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/New_in_JavaScript/1.8.1">JavaScript 1.8.1</a></dt>
+ <dd>Version shipped in Firefox 3.5. Released on June 30, 2009.<br>
+ Includes the TraceMonkey JIT and supports native JSON.</dd>
+ <dt>JavaScript 1.8.2</dt>
+ <dd>Version shipped in Firefox 3.6. Released June 22, 2009.<br>
+ Includes only minor changes.</dd>
+ <dt><a href="/zh-TW/docs/Web/JavaScript/New_in_JavaScript/1.8.5">JavaScript 1.8.5</a></dt>
+ <dd>Version shipped in Firefox 4. Released July 27, 2010.<br>
+ Includes many new features for ECMA-262 Edition 5 compliance.<br>
+ This is the last JavaScript version.</dd>
+</dl>