摘要: 1.扁平化数组 arr.flat(n),n表示扁平化的次数,为Infinity let arr = [1, [2, 3, [4, 5]]]; arr.flat(Infinity) function flatten(arr) { while(arr.some(item=>Array.isArray(i 阅读全文
posted @ 2020-01-20 13:58 把我当做一棵树叭 阅读(216) 评论(0) 推荐(0)