From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../global_objects/map/entries/index.html | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 files/ja/web/javascript/reference/global_objects/map/entries/index.html (limited to 'files/ja/web/javascript/reference/global_objects/map/entries/index.html') diff --git a/files/ja/web/javascript/reference/global_objects/map/entries/index.html b/files/ja/web/javascript/reference/global_objects/map/entries/index.html new file mode 100644 index 0000000000..fd4710ebf5 --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/map/entries/index.html @@ -0,0 +1,71 @@ +--- +title: Map.prototype.entries() +slug: Web/JavaScript/Reference/Global_Objects/Map/entries +tags: + - ECMAScript 2015 + - Iterator + - JavaScript + - Map + - Method + - Prototype +translation_of: Web/JavaScript/Reference/Global_Objects/Map/entries +--- +
{{JSRef}}
+ +

entries() メソッドは、挿入順で Map オブジェクトの要素に対する [key, value] ペアを含む新しい Iterator オブジェクトを返します。

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

構文

+ +
myMap.entries()
+ +

返値

+ +

新しい {{jsxref("Map")}} の反復子オブジェクトです。

+ +

+ +

entries() の使用

+ +
let myMap = new Map()
+myMap.set('0', 'foo')
+myMap.set(1, 'bar')
+myMap.set({}, 'baz')
+
+let mapIter = myMap.entries()
+
+console.log(mapIter.next().value)  // ["0", "foo"]
+console.log(mapIter.next().value)  // [1, "bar"]
+console.log(mapIter.next().value)  // [Object, "baz"]
+
+ +

仕様書

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

ブラウザーの互換性

+ + + +

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

+ +

関連情報

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