一、Symbol数据类型(ES6新数据类型):声明一个独一无二的值
var str1 = Symbol("jhh");
var str2 = Symbol("jhh");
console.log(str1 === str2);
二、Set:类似数组,成员唯一
var arr = new Set([1,2,3,3,5]);
console.log(arr.size);
arr.add(6);
console.log(arr);
console.log(arr.size);
arr.delete(1)
console.log(arr);
arr.clear();
console.log(arr);
var arr2 = [1,2,2,4];
var arr3 = [...new Set(arr2)];
console.log(arr3);
三、Map: 是键值对的集合,但键不限于字符串
var map = new Map();
map.set("a","jhh");
console.log(map.get("a"));
var obj = ['b'];
map.set(obj,"hhj");
console.log(map.get(obj));
console.log(map);