diff options
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/array/flat/index.html')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/array/flat/index.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/flat/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/flat/index.html index 4f06aff1fc..ec0af471c3 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/flat/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/flat/index.html @@ -76,7 +76,7 @@ arr.reduce((acc, val) => acc.concat(val), []); // 使用扩展运算符 ... const flattened = arr => [].concat(...arr);</code></pre> -<h3 class="brush: js" id="reduce_concat_isArray_recursivity">reduce + concat + isArray + recursivity</h3> +<h3 id="reduce_concat_isArray_recursivity">reduce + concat + isArray + recursivity</h3> <pre class="brush: js">// 使用 reduce、concat 和递归展开无限多层嵌套的数组 var arr1 = [1,2,3,[1,2,3,4, [2,3,4]]]; |