Map.prototype.keys()

El metodo keys() returna un nuevo objeto Iterator que contiene las llaves/keys por cada elemento en el objeto en orden de insercion.

Syntax

myMap.keys()

Ejemplos

Usando keys()

var myMap = new Map();
myMap.set("0", "foo");
myMap.set(1, "bar");
myMap.set({}, "baz");

var mapIter = myMap.keys();

console.log(mapIter.next().value); // "0"
console.log(mapIter.next().value); // 1
console.log(mapIter.next().value); // Object

Especificaciones

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 38 20 (20) Sin soporte 25 7.1
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support Sin soporte 38 20.0 (20) Sin soporte Sin soporte 8

See also