We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
No description provided.
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
// 答案与解析 1)Set 成员唯一、无序且不重复; [value, value],键值与键名是一致的(或者说只有键值,没有键名); 可以遍历,方法有:add、delete、has。
2)WeakSet 成员都是对象; 成员都是弱引用,可以被垃圾回收机制回收,可以用来保存DOM节点,不容易造成内存泄漏; 不能遍历,方法有 add、delete、has。
3)Map 本质上是键值对的集合,类似集合; 可以遍历,方法很多,可以跟各种数据格式转换。
4)WeakMap 只接受对象作为键名(null 除外),不接受其他类型的值作为键名; 键名是弱引用,键值可以是任意的,键名所指向的对象可以被垃圾回收,此时键名是无效的; 不能遍历,方法有 get、set、has、delete。
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: