WeakSet.prototype.has()
WeakSet 实例的 has() 方法返回一个布尔值,指示该 WeakSet 中是否存在对象。
¥The has() method of WeakSet instances returns a boolean indicating whether an
object exists in this WeakSet or not.
Try it
语法
参数
返回值
¥Return value
如果 WeakSet 对象中存在具有指定值的元素,则返回 true;否则 false。如果 value 不是对象或 未注册符号,则始终返回 false。
¥Returns true if an element with the specified value exists in the WeakSet object; otherwise false. Always returns false if value is not an object or a non-registered symbol.
示例
使用 has() 方法
规范
| Specification |
|---|
| ECMAScript Language Specification # sec-weakset.prototype.has |
浏览器兼容性
BCD tables only load in the browser