Map.prototype.values()
values()
メソッドは、 Map
オブジェクトに挿入された要素を挿入順に列挙する新しいイテレーターオブジェクトを返します。
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
構文
myMap.values()
返値
Map
の新しいイテレーターオブジェクト。
例
values() の使用
var myMap = new Map();
myMap.set('0', 'foo');
myMap.set(1, 'bar');
myMap.set({}, 'baz');
var mapIter = myMap.values();
console.log(mapIter.next().value); // "foo"
console.log(mapIter.next().value); // "bar"
console.log(mapIter.next().value); // "baz"
仕様書
ブラウザーの互換性
BCD tables only load in the browser