摘要: push, pop, shift, unshift const arr = [10, 20, 30, 40] const popRes = arr.pop() // 返回被删的值 const shiftRes = arr.shift() // 返回被删的值 const pushRes = arr.p 阅读全文
posted @ 2021-01-08 15:25 大海博客 阅读(108) 评论(0) 推荐(0)
摘要: 纯函数有两个特点:1. 不改变原数组(没有副作用);2. 返回一个数组 1. Arrat.concat(value) 合并数组并返回一个新数组,不对原数组做改变 let array = [1,2,3,4,5]; let x = array.concat([10,20]); console.log(x 阅读全文
posted @ 2021-01-08 15:04 大海博客 阅读(99) 评论(0) 推荐(0)