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 --- .../zh-tw/web/javascript/reference/operators/spread_syntax/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'files/zh-tw/web/javascript/reference/operators/spread_syntax') diff --git a/files/zh-tw/web/javascript/reference/operators/spread_syntax/index.html b/files/zh-tw/web/javascript/reference/operators/spread_syntax/index.html index 6b69748661..a9d0af6472 100644 --- a/files/zh-tw/web/javascript/reference/operators/spread_syntax/index.html +++ b/files/zh-tw/web/javascript/reference/operators/spread_syntax/index.html @@ -111,7 +111,7 @@ arr2.push(4); // arr remains unaffected -
+

Note: Spread syntax effectively goes one level deep while copying an array. Therefore, it may be unsuitable for copying multidimensional arrays, as the following example shows. (The same is true with {{jsxref("Object.assign()")}} and spread syntax.)

const a = [[1], [2], [3]];
@@ -165,7 +165,7 @@ arr1 = [...arr2, ...arr1];
 //  arr1 is now [3, 4, 5, 0, 1, 2]
 
-
+

Note: Unlike unshift(), this creates a new arr1, and does not modify the original arr1 array in-place.

-- cgit v1.2.3-54-g00ecf