//ES6 //[学生的名字,学生的成绩] // var names = ["tom","jack","peter"]; // var scores = [100,90,80];
'use strict'; var map = newMap([["tom",100],["jack",90],["peter",80]]); var name = map.get('tom');//通过key值来获得value map.set('admin',999);//新增或修改 map.delete('tom');//删除
Set:
1 2 3 4 5
'use strict'; var set = newSet([1,2,8,9,15]) set.add(2); set.delete(1); console.log(set.has(3))