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/has/index.html | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 files/ja/web/javascript/reference/global_objects/map/has/index.html (limited to 'files/ja/web/javascript/reference/global_objects/map/has') diff --git a/files/ja/web/javascript/reference/global_objects/map/has/index.html b/files/ja/web/javascript/reference/global_objects/map/has/index.html new file mode 100644 index 0000000000..16995027a8 --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/map/has/index.html @@ -0,0 +1,71 @@ +--- +title: Map.prototype.has() +slug: Web/JavaScript/Reference/Global_Objects/Map/has +tags: + - ECMAScript 2015 + - JavaScript + - Map + - Method + - Prototype + - Reference +translation_of: Web/JavaScript/Reference/Global_Objects/Map/has +original_slug: Web/JavaScript/Reference/Global_Objects/Map/has +--- +
{{JSRef}}
+ +

has() メソッドは、指定されたキーに対する要素が存在するかどうかを示す論理値を返します。

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

構文

+ +
myMap.has(key)
+ +

引数

+ +
+
key
+
Map オブジェクト内に存在するかテストするための要素のキーです。
+
+ +

返値

+ +

特定のキーに対する要素が Map オブジェクト内に存在していたら、true を返します。さもなければ、false を返します。

+ +

+ +

has() の使用

+ +
let myMap = new Map()
+myMap.set('bar', "foo")
+
+myMap.has('bar')   // returns true
+myMap.has('baz')   // returns false
+
+ +

仕様書

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

ブラウザーの互換性

+ +

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

+ +

関連情報

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