Skip to content

Commit

Permalink
[es] translate map has
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker8 committed Aug 23, 2024
1 parent 334128c commit b462b3e
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions files/es/web/javascript/reference/global_objects/map/has/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Map.prototype.has()
slug: Web/JavaScript/Reference/Global_Objects/Map/has
l10n:
sourceCommit: 3cfd663738e9963157d90f359789d675a6662ec2
---

{{JSRef}}

El método **`has()`** de las instancias {{jsxref("Map")}} regresa un booleano indicando si un elemento con la llave especificada existe o no en este _map_.

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

## Sintaxis

```js-nolint
has(key)
```

### Parámetros

- `key`
- : La llave del elemento que se quiere probar si existe en el objeto `Map`.

### Valor devuelto

`true` si un elemento con la llave especificada existe en el objeto `Map`; de lo contrario `false`.

## Ejemplos

### Usando has()

```js
const myMap = new Map();
myMap.set("bar", "foo");

console.log(myMap.has("bar")); // true
console.log(myMap.has("baz")); // false
```

## Especificaciones

{{Specifications}}

## Compatibilidad con navegadores

{{Compat}}

## Véase también

- {{jsxref("Map")}}
- {{jsxref("Map.prototype.set()")}}
- {{jsxref("Map.prototype.get()")}}

0 comments on commit b462b3e

Please sign in to comment.