diff options
author | zmheang <38063262+zmheang@users.noreply.github.com> | 2021-06-30 14:07:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-30 14:07:38 +0800 |
commit | c7dc6954326e240634081295a64236a45e911f78 (patch) | |
tree | 163956270d22fa6cdb7964f516d4c2f869661682 /files/zh-cn/web/javascript/reference/global_objects | |
parent | c98a9b1cf02d9143cc6924f1991d600c0f807411 (diff) | |
download | translated-content-c7dc6954326e240634081295a64236a45e911f78.tar.gz translated-content-c7dc6954326e240634081295a64236a45e911f78.tar.bz2 translated-content-c7dc6954326e240634081295a64236a45e911f78.zip |
Update Web/JavaScript/Reference/Global_Objects/Array/splice, zh-CN (#1343)
第n位 -> 索引 n 的位置
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/array/splice/index.html | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/splice/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/splice/index.html index dc8bc3fbf6..0ce5aba69f 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/splice/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/splice/index.html @@ -47,7 +47,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/splice <h2 id="示例">示例</h2> -<h3 id="从第_2_位开始删除_0_个元素,插入“drum”">从第 2 位开始删除 0 个元素,插入“drum”</h3> +<h3 id="从索引_2_的位置开始删除_0_个元素,插入“drum”">从索引 2 的位置开始删除 0 个元素,插入“drum”</h3> <pre class="brush: js">var myFish = ["angel", "clown", "mandarin", "sturgeon"]; var removed = myFish.splice(2, 0, "drum"); @@ -56,7 +56,7 @@ var removed = myFish.splice(2, 0, "drum"); // 被删除的元素: [], 没有元素被删除 </pre> -<h3 id="从第_2_位开始删除_0_个元素,插入“drum”_和_guitar">从第 2 位开始删除 0 个元素,插入“drum” 和 "guitar"</h3> +<h3 id="从索引_2_的位置开始删除_0_个元素,插入“drum”_和_guitar">从索引 2 的位置开始删除 0 个元素,插入“drum” 和 "guitar"</h3> <pre class="brush: js">var myFish = ['angel', 'clown', 'mandarin', 'sturgeon']; var removed = myFish.splice(2, 0, 'drum', 'guitar'); @@ -65,7 +65,7 @@ var removed = myFish.splice(2, 0, 'drum', 'guitar'); // 被删除的元素: [], 没有元素被删除 </pre> -<h3 id="从第_3_位开始删除_1_个元素">从第 3 位开始删除 1 个元素</h3> +<h3 id="从索引_3_的位置开始删除_1_个元素">从索引 3 的位置开始删除 1 个元素</h3> <pre class="brush: js">var myFish = ['angel', 'clown', 'drum', 'mandarin', 'sturgeon']; var removed = myFish.splice(3, 1); @@ -74,7 +74,7 @@ var removed = myFish.splice(3, 1); // 被删除的元素: ["mandarin"] </pre> -<h3 id="从第_2_位开始删除_1_个元素,插入“trumpet”">从第 2 位开始删除 1 个元素,插入“trumpet”</h3> +<h3 id="从索引_2_的位置开始删除_1_个元素,插入“trumpet”">从索引 2 的位置开始删除 1 个元素,插入“trumpet”</h3> <pre class="brush: js">var myFish = ['angel', 'clown', 'drum', 'sturgeon']; var removed = myFish.splice(2, 1, "trumpet"); @@ -83,7 +83,7 @@ var removed = myFish.splice(2, 1, "trumpet"); // 被删除的元素: ["drum"] </pre> -<h3 id="从第_0_位开始删除_2_个元素,插入parrot、anemone和blue">从第 0 位开始删除 2 个元素,插入"parrot"、"anemone"和"blue"</h3> +<h3 id="从索引_0_的位置开始删除_2_个元素,插入parrot、anemone和blue">从索引 0 的位置开始删除 2 个元素,插入"parrot"、"anemone"和"blue"</h3> <pre class="brush: js">var myFish = ['angel', 'clown', 'trumpet', 'sturgeon']; var removed = myFish.splice(0, 2, 'parrot', 'anemone', 'blue'); @@ -92,7 +92,7 @@ var removed = myFish.splice(0, 2, 'parrot', 'anemone', 'blue'); // 被删除的元素: ["angel", "clown"] </pre> -<h3 id="从第_2_位开始删除_2_个元素">从第 2 位开始删除 2 个元素</h3> +<h3 id="从索引_2_的位置位开始删除_2_个元素">从索引 2 的位置开始删除 2 个元素</h3> <pre class="brush: js">var myFish = ['parrot', 'anemone', 'blue', 'trumpet', 'sturgeon']; var removed = myFish.splice(myFish.length - 3, 2); @@ -101,7 +101,7 @@ var removed = myFish.splice(myFish.length - 3, 2); // 被删除的元素: ["blue", "trumpet"] </pre> -<h3 id="从倒数第_2_位开始删除_1_个元素">从倒数第 2 位开始删除 1 个元素</h3> +<h3 id="从索引_-2_的位置开始删除_1_个元素">从索引 -2 的位置开始删除 1 个元素</h3> <pre class="brush: js">var myFish = ['angel', 'clown', 'mandarin', 'sturgeon']; var removed = myFish.splice(-2, 1); @@ -109,7 +109,7 @@ var removed = myFish.splice(-2, 1); // 运算后的 myFish: ["angel", "clown", "sturgeon"] // 被删除的元素: ["mandarin"]</pre> -<h3 id="从第_2_位开始删除所有元素">从第 2 位开始删除所有元素</h3> +<h3 id="从索引_2_的位置开始删除所有元素">从索引 2 的位置开始删除所有元素</h3> <pre class="brush: js">var myFish = ['angel', 'clown', 'mandarin', 'sturgeon']; var removed = myFish.splice(2); |