set相似於數組,可是它不包含重複值
map相似於對象,能夠以任意值作key
均繼承了迭代器接口數組
set: add(), delete() ,has(),clear() size屬性 map: set(),get(),remove()對象
entries(), forEach, for of, keys(), values(),繼承
1 set: 數組去重
與...一齊使用 2 map的遍歷和過濾
經過使用數組的map和filter方法 先用...將map 轉數組結構,最後用new map將數組轉map結構接口
弱應用,成員都是對象,不使用時,會自動被垃圾回收機制回收
weakset無size屬性rem