Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set #218

Closed
xiaoxixi6633 opened this issue Jul 25, 2019 · 0 comments
Closed

Set #218

xiaoxixi6633 opened this issue Jul 25, 2019 · 0 comments

Comments

@xiaoxixi6633
Copy link

Set
1.成员不能重复
2.只有健值,没有健名,有点类似数组。
3. 可以遍历,方法有add, delete,has
weakSet

  1. 成员都是对象
  2. 成员都是弱引用,随时可以消失。 可以用来保存DOM节点,不容易造成内存泄漏
  3. 不能遍历,方法有add, delete,has
    Map
  4. 本质上是健值对的集合,类似集合
  5. 可以遍历,方法很多,可以干跟各种数据格式转换
    weakMap
    1.直接受对象作为健名(null除外),不接受其他类型的值作为健名
  6. 健名所指向的对象,不计入垃圾回收机制
  7. 不能遍历,方法同get,set,has,delete

Originally posted by @1138663994 in #6 (comment)

@yygmind yygmind closed this as completed Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants