From 52ccdf1f0a1cee3f0659ac78e81c79dae152399b Mon Sep 17 00:00:00 2001 From: MDN Date: Wed, 23 Jun 2021 00:34:06 +0000 Subject: [CRON] sync translated content --- .../reference/global_objects/map/clear/index.html | 76 ---------------------- 1 file changed, 76 deletions(-) delete mode 100644 files/zh-cn/web/javascript/reference/global_objects/map/clear/index.html (limited to 'files/zh-cn/web/javascript/reference/global_objects/map/clear') diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/clear/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/clear/index.html deleted file mode 100644 index 8244d179c2..0000000000 --- a/files/zh-cn/web/javascript/reference/global_objects/map/clear/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: Map.prototype.clear() -slug: Web/JavaScript/Reference/Global_Objects/Map/clear -tags: - - ECMAScript 2015 - - JavaScript - - Map -translation_of: Web/JavaScript/Reference/Global_Objects/Map/clear ---- -
{{JSRef}}
- -

clear()方法会移除Map对象中的所有元素。

- -
{{EmbedInteractiveExample("pages/js/map-prototype-clear.html")}}
- - - -

语法

- -
myMap.clear();
-
- -

返回值

- -

{{jsxref("undefined")}}.

- -

示例

- -

调用clear方法

- -
var myMap = new Map();
-myMap.set("bar", "baz");
-myMap.set(1, "foo");
-
-myMap.size;       // 2
-myMap.has("bar"); // true
-
-myMap.clear();
-
-myMap.size;       // 0
-myMap.has("bar")  // false
-
- -

规范

- - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('ES2015', '#sec-map.prototype.clear', 'Map.prototype.clear')}}{{Spec2('ES2015')}}Initial definition.
{{SpecName('ESDraft', '#sec-map.prototype.clear', 'Map.prototype.clear')}}{{Spec2('ESDraft')}} 
- -

浏览器兼容

- - - -

{{Compat("javascript.builtins.Map.clear")}}

- -

相关链接

- - -- cgit v1.2.3-54-g00ecf