-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[es] Web/JavaScript/Reference/Global_Objects/Map/keys (#23221)
* [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
1 parent
c275ce1
commit 995327d
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
files/es/web/javascript/reference/global_objects/map/keys/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()")}} |