摘要: // apply 的第二参数通常是数组 但是也可以传递类数组对象{length: 2}console.log(Array.apply(null, {length: 2})) // [undefined, undefined]// 1 熟悉一点: {length: 2}作为Array.apply第二个 阅读全文
posted @ 2019-06-14 18:20 hellojinjin123 阅读(239) 评论(0) 推荐(0)
摘要: // es6 set数据结构 生成一个数据集 里面的元素是唯一的 const items = new Set([1, 2, 3, 4, 5, 5, 5, 5]); // items 是个对象 items.size // 5 console.log(items.has(1... 阅读全文
posted @ 2019-06-14 15:11 hellojinjin123 阅读(1687) 评论(0) 推荐(0)