From f45e9e070c93ebbd83d488bdd775987a4d75c201 Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:08 +0800 Subject: fix yari h2m dry run errors --- .../functions/arguments/callee/index.html | 82 +--------------------- .../reference/functions/arguments/index.html | 12 ++-- 2 files changed, 9 insertions(+), 85 deletions(-) (limited to 'files/zh-tw/web/javascript/reference/functions/arguments') 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

callee is a property of the arguments 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").

-
Warning: The 5th edition of ECMAScript (ES5) forbids use of arguments.callee() in strict mode. Avoid using arguments.callee() by either giving function expressions a name or use a function declaration where a function must call itself.
+

Warning: The 5th edition of ECMAScript (ES5) forbids use of arguments.callee() in strict mode. Avoid using arguments.callee() by either giving function expressions a name or use a function declaration where a function must call itself.

Why was arguments.callee removed from ES5 strict mode?

@@ -108,87 +108,11 @@ john();

規範

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('ES1')}}{{Spec2('ES1')}}Initial definition. Implemented in JavaScript 1.2
{{SpecName('ES5.1', '#sec-10.6', 'Arguments Object')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-arguments-exotic-objects', 'Arguments Exotic Objects')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-arguments-exotic-objects', 'Arguments Exotic Objects')}}{{Spec2('ESDraft')}} 
+{{Specifications}}

瀏覽器相容性

-

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
+{{Compat}}

參見

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

描述

-
-

Note: 如果你有在使用 ES6 語法,建議參考其餘參數

+
+

備註:如果你有在使用 ES6 語法,建議參考其餘參數

-
-

Note: 「類陣列 (Array-like)」 的意思是 arguments 一樣擁有 length這項屬性,以及從 0 開始的索引,但是它沒有陣列內建的方法像是 forEach() ,或是 map() 。

+
+

備註:「類陣列 (Array-like)」 的意思是 arguments 一樣擁有 length這項屬性,以及從 0 開始的索引,但是它沒有陣列內建的方法像是 forEach() ,或是 map() 。

The arguments 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 arguments object. This object contains an entry for each argument passed to the function, the first entry's index starting at 0.

@@ -52,8 +52,8 @@ var args = [].slice.call(arguments); const args = Array.from(arguments); -
-

Using slice on arguments prevents optimizations in some JavaScript engines (V8 for example - more information). 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 Array constructor as a function:

+
+

警告:Using slice on arguments prevents optimizations in some JavaScript engines (V8 for example - more information). 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 Array constructor as a function:

var args = (arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments));
-- cgit v1.2.3-54-g00ecf