aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/web/javascript/reference/functions/arguments
diff options
context:
space:
mode:
authort7yang <t7yang@gmail.com>2022-01-10 08:38:08 +0800
committerIrvin <irvinfly@gmail.com>2022-02-16 02:35:54 +0800
commitf45e9e070c93ebbd83d488bdd775987a4d75c201 (patch)
treeaacef5edaf768a188cadc46860f5b6aaa74f39ef /files/zh-tw/web/javascript/reference/functions/arguments
parent8ccfa93045a6c119303566370999f59a0aae3b25 (diff)
downloadtranslated-content-f45e9e070c93ebbd83d488bdd775987a4d75c201.tar.gz
translated-content-f45e9e070c93ebbd83d488bdd775987a4d75c201.tar.bz2
translated-content-f45e9e070c93ebbd83d488bdd775987a4d75c201.zip
fix yari h2m dry run errors
Diffstat (limited to 'files/zh-tw/web/javascript/reference/functions/arguments')
-rw-r--r--files/zh-tw/web/javascript/reference/functions/arguments/callee/index.html82
-rw-r--r--files/zh-tw/web/javascript/reference/functions/arguments/index.html12
2 files changed, 9 insertions, 85 deletions
diff --git a/files/zh-tw/web/javascript/reference/functions/arguments/callee/index.html b/files/zh-tw/web/javascript/reference/functions/arguments/callee/index.html
index fe8b1dcda3..fa0a7fe9ab 100644
--- a/files/zh-tw/web/javascript/reference/functions/arguments/callee/index.html
+++ b/files/zh-tw/web/javascript/reference/functions/arguments/callee/index.html
@@ -11,7 +11,7 @@ translation_of: Web/JavaScript/Reference/Functions/arguments/callee
<p><code>callee</code> is a property of the <code>arguments</code> object. It can be used to refer to the currently executing function inside the function body of that function. This is useful when the name of the function is unknown, such as within a function expression with no name (also called "anonymous functions").</p>
-<div class="warning"><strong>Warning:</strong> The 5th edition of ECMAScript (ES5) forbids use of <code>arguments.callee()</code> in <a href="/en-US/docs/JavaScript/Reference/Functions_and_function_scope/Strict_mode" title="/en-US/docs/JavaScript/Reference/Functions_and_function_scope/Strict_mode">strict mode</a>. Avoid using <code>arguments.callee()</code> by either giving function expressions a name or use a function declaration where a function must call itself.</div>
+<div class="notecard warning"><p><strong>Warning:</strong> The 5th edition of ECMAScript (ES5) forbids use of <code>arguments.callee()</code> in <a href="/en-US/docs/JavaScript/Reference/Functions_and_function_scope/Strict_mode" title="/en-US/docs/JavaScript/Reference/Functions_and_function_scope/Strict_mode">strict mode</a>. Avoid using <code>arguments.callee()</code> by either giving function expressions a name or use a function declaration where a function must call itself.</p></div>
<h3 id="Why_was_arguments.callee_removed_from_ES5_strict_mode">Why was <code>arguments.callee</code> removed from ES5 strict mode?</h3>
@@ -108,87 +108,11 @@ john();</pre>
<h2 id="規範">規範</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <th scope="col">Specification</th>
- <th scope="col">Status</th>
- <th scope="col">Comment</th>
- </tr>
- <tr>
- <td>{{SpecName('ES1')}}</td>
- <td>{{Spec2('ES1')}}</td>
- <td>Initial definition. Implemented in JavaScript 1.2</td>
- </tr>
- <tr>
- <td>{{SpecName('ES5.1', '#sec-10.6', 'Arguments Object')}}</td>
- <td>{{Spec2('ES5.1')}}</td>
- <td> </td>
- </tr>
- <tr>
- <td>{{SpecName('ES6', '#sec-arguments-exotic-objects', 'Arguments Exotic Objects')}}</td>
- <td>{{Spec2('ES6')}}</td>
- <td> </td>
- </tr>
- <tr>
- <td>{{SpecName('ESDraft', '#sec-arguments-exotic-objects', 'Arguments Exotic Objects')}}</td>
- <td>{{Spec2('ESDraft')}}</td>
- <td> </td>
- </tr>
- </tbody>
-</table>
+{{Specifications}}
<h2 id="瀏覽器相容性">瀏覽器相容性</h2>
-<p>{{CompatibilityTable}}</p>
-
-<div>
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div>
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Chrome for Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- </tr>
- </tbody>
-</table>
-</div>
+{{Compat}}
<h2 id="參見">參見</h2>
diff --git a/files/zh-tw/web/javascript/reference/functions/arguments/index.html b/files/zh-tw/web/javascript/reference/functions/arguments/index.html
index ddccefae10..3a670e1f3c 100644
--- a/files/zh-tw/web/javascript/reference/functions/arguments/index.html
+++ b/files/zh-tw/web/javascript/reference/functions/arguments/index.html
@@ -20,12 +20,12 @@ translation_of: Web/JavaScript/Reference/Functions/arguments
<h2 id="描述">描述</h2>
-<div class="blockIndicator note">
-<p>Note: 如果你有在使用 ES6 語法,建議參考<a href="https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Functions/rest_parameters">其餘參數</a>。</p>
+<div class="notecard note">
+<p><strong>備註:</strong>如果你有在使用 ES6 語法,建議參考<a href="https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Functions/rest_parameters">其餘參數</a>。</p>
</div>
-<div class="blockIndicator note">
-<p>Note: 「類陣列 (Array-like)」 的意思是 <code>arguments</code> 一樣擁有 <code>length</code>這項屬性,以及從 0 開始的索引,但是它沒有陣列內建的方法像是 <code>forEach()</code> ,或是 <code>map()</code> 。</p>
+<div class="notecard note">
+<p><strong>備註:</strong>「類陣列 (Array-like)」 的意思是 <code>arguments</code> 一樣擁有 <code>length</code>這項屬性,以及從 0 開始的索引,但是它沒有陣列內建的方法像是 <code>forEach()</code> ,或是 <code>map()</code> 。</p>
</div>
<p>The <code>arguments</code> object is a local variable available within all (non-arrow) functions. You can refer to a function's arguments within the function by using the <code>arguments</code> object. This object contains an entry for each argument passed to the function, the first entry's index starting at 0.</p>
@@ -52,8 +52,8 @@ var args = [].slice.call(arguments);
const args = Array.from(arguments);
</pre>
-<div class="warning">
-<p class="brush: js">Using slice on arguments prevents optimizations in some JavaScript engines (V8 for example - <a href="https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments">more information</a>). If you care for them, try constructing a new array by iterating through the arguments object instead. An alternative would be to use the despised <code>Array</code> constructor as a function:</p>
+<div class="notecard warning">
+<p><strong>警告:</strong>Using slice on arguments prevents optimizations in some JavaScript engines (V8 for example - <a href="https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments">more information</a>). If you care for them, try constructing a new array by iterating through the arguments object instead. An alternative would be to use the despised <code>Array</code> constructor as a function:</p>
<pre class="brush: js">var args = (arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments));</pre>
</div>