A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Map/values below:

Map.prototype.values() - JavaScript | MDN

Map.prototype.values()

Baseline Widely available

La méthode values() renvoie un objet Iterator qui contient les valeurs de chacun des éléments contenu dans l'objet Map donné, dans leur ordre d'insertion.

Exemple interactif
const map1 = new Map();

map1.set("0", "foo");
map1.set(1, "bar");

const iterator1 = map1.values();

console.log(iterator1.next().value);
// Expected output: "foo"

console.log(iterator1.next().value);
// Expected output: "bar"
Syntaxe Valeur de retour

Un nouvel objet Iterator Map.

Exemple Utiliser values()
var maMap = new Map();
maMap.set("0", "toto");
maMap.set(1, "truc");
maMap.set({}, "licorne");

var mapIter = maMap.values();

console.log(mapIter.next().value); // "toto"
console.log(mapIter.next().value); // "truc"
console.log(mapIter.next().value); // "licorne"
Spécifications Compatibilité des navigateurs Voir aussi

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4