From f3bfeb89f97f0bbf4bfd09ab507395ee321c1413 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Fri, 23 Jul 2021 11:06:19 -0400 Subject: wasn't supposed to be orphaned (ja) (#1672) * wasn't supposed to be orphaned (ja) * fix redirects * fix slug front-matter --- .../reference/global_objects/map/clear/index.html | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 files/ja/web/javascript/reference/global_objects/map/clear/index.html (limited to 'files/ja/web/javascript/reference/global_objects/map/clear') diff --git a/files/ja/web/javascript/reference/global_objects/map/clear/index.html b/files/ja/web/javascript/reference/global_objects/map/clear/index.html new file mode 100644 index 0000000000..3518878ab6 --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/map/clear/index.html @@ -0,0 +1,71 @@ +--- +title: Map.prototype.clear() +slug: Web/JavaScript/Reference/Global_Objects/Map/clear +tags: + - ECMAScript 2015 + - JavaScript + - Map + - Method + - Prototype + - Reference +translation_of: Web/JavaScript/Reference/Global_Objects/Map/clear +original_slug: 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
+
+ +

仕様書

+ + + + + + + + + + + + +
仕様書
{{SpecName('ESDraft', '#sec-map.prototype.clear', 'Map.prototype.clear')}}
+ +

ブラウザーの互換性

+ +

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

+ +

関連情報

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