摘要: let arr =Array.from({length:100}).map((x,i)=> { return {label:`label${i}`,value:`value${i}`} } ) console.log("arr",arr); 阅读全文
posted @ 2022-01-15 00:37 Evhgjvggg 阅读(61) 评论(0) 推荐(0)
摘要: 从一个数组对象中删除一些数组的方法: 1、 1 for (let i = 0; i < parentNode.length; i++) { 2 if(parentNode[i].Code.length>4){ 3 parentNode.splice(i,1) 4 i-- 5 } 6 } 因为spli 阅读全文
posted @ 2021-12-29 19:35 Evhgjvggg 阅读(437) 评论(0) 推荐(0)
摘要: 不存在变量提升 暂时性死区(typeof不是百分百安全) 也是因为暂时性死区。使用let声明变量时,只要变量在还没有声明完成前使用,就会报错。 不允许重复声明 总结: ES6 规定暂时性死区和let、const语句不出现变量提升,主要是为了减少运行时错误,防止在变量声明前就使用这个变量,从而导致意料 阅读全文
posted @ 2021-12-04 11:35 Evhgjvggg 阅读(50) 评论(0) 推荐(0)