WeakMap.prototype.delete()
WeakMap
实例的 delete()
方法从此 WeakMap
中删除指定元素。
¥The delete()
method of WeakMap
instances removes the specified element from this WeakMap
.
Try it
语法
参数
返回值
¥Return value
true
(如果 WeakMap
对象中的元素已成功删除)。如果在 WeakMap
中找不到密钥,则为 false
。如果 key
不是对象或 未注册符号,则始终返回 false
。
¥true
if an element in the WeakMap
object has been removed successfully. false
if the key is not found in the WeakMap
. Always returns false
if key
is not an object or a non-registered symbol.
示例
使用 delete()方法
规范
Specification |
---|
ECMAScript Language Specification # sec-weakmap.prototype.delete |
浏览器兼容性
BCD tables only load in the browser
也可以看看
¥See also