ES6 decided that Array Comprehensions will not included in this version, ES7 will include this. Therefore, only FireFox support this, you can test it under FireFox Firebug. Since CoffeeScrip also has array comprehension, let's go over how it looks in…
//Map与Array的对比 { let map=new Map(); let array=[]; //增 map.set('t',1); array.push({t:1}); console.info('map-Array',map,array); //查 let map_exist=map.has('t'); let array_exist=array.find(item=>item.t); console.info('map-Array',map_exist,array_exist);//…
//Set { let list=new Set(); list.add(5);//添加 list.add(7); //属性size就是长度 console.log('size',list.size); } { let arr = [1,2,3,4,5]; let list = new Set(arr); console.log(list.size); } { //去重 let list = new Set(); list.add(1); list.add(2); list.add(1); co…