Skip to content

Commit

Permalink
[es] Web/JavaScript/Reference/Global_Objects/Map/keys (#23221)
Browse files Browse the repository at this point in the history
* [es] translate map keys

* Update files/es/web/javascript/reference/global_objects/map/keys/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
seeker8 and github-actions[bot] authored Aug 26, 2024
1 parent c275ce1 commit 995327d
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions files/es/web/javascript/reference/global_objects/map/keys/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Map.prototype.keys()
slug: Web/JavaScript/Reference/Global_Objects/Map/keys
l10n:
sourceCommit: 27180875516cc311342e74b596bfb589b7211e0c
---

{{JSRef}}

El método **`keys()`** de las instancias {{jsxref("Map")}} regresa un nuevo objeto _[iterator de map](/es/docs/Web/JavaScript/Reference/Global_Objects/Iterator)_ que contiene las llaves para cada elemento en este _map_ en orden de inserción.

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

## Sintaxis

```js-nolint
keys()
```

### Parámetros

Ningúno.

### Valor devuelto

Un nuevo [objeto iterator iterable](/es/docs/Web/JavaScript/Reference/Global_Objects/Iterator).

## Ejemplos

### Usando keys()

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

const mapIter = myMap.keys();

console.log(mapIter.next().value); // "0"
console.log(mapIter.next().value); // 1
console.log(mapIter.next().value); // {}
```

## Especificaciones

{{Specifications}}

## Compatibilidad con navegadores

{{Compat}}

## Véase también

- {{jsxref("Map.prototype.entries()")}}
- {{jsxref("Map.prototype.values()")}}

0 comments on commit 995327d

Please sign in to comment.