Set, the difference between Map, WeakSet and WeakMap of?

Specific can see http://es6.ruanyifeng.com/#docs/set-map

The SET
1. members can not repeat
2. The only key value, not the name of health, somewhat similar to the array.
3. Can traversal methods have the Add, the Delete, has
weakSet

    1. Members are subject
    2. Members are weak references, you can disappear at any time. DOM node can be used to save, not likely to cause a memory leak
    3. You can not traverse, the method has the Add, the Delete, has
      the Map
    4. Is a collection of key value pairs in essence, a similar collection
    5. May traverse, many ways, can do with a variety of data format conversion
      weakMap
      1. directly affected by the object name as Jian (excluding null), other types of values are not accepted as the name of health
    6. Kin name is pointing to objects, not included in garbage collection
    7. Can not traverse, the method with get, set, has, delete

Guess you like

Origin www.cnblogs.com/MrHaoRoot/p/11162196.html