Skip to content

Commit

Permalink
[es] Web/JavaScript/Reference/Global_Objects/Map/delete (#23193)
Browse files Browse the repository at this point in the history
[es] translate map delete
  • Loading branch information
seeker8 authored Aug 22, 2024
1 parent b761196 commit 4868ee5
Showing 1 changed file with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: Map.prototype.delete()
slug: Web/JavaScript/Reference/Global_Objects/Map/delete
l10n:
sourceCommit: 88d71e500938fa8ca969fe4fe3c80a5abe23d767
---

{{JSRef}}

El método **`delete()`** de las instancias {{jsxref("Map")}} remueve el elemento especificado de este _map_ utilizando la llave del elemento que se quiere remover.

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

## Sintaxis

```js-nolint
mapInstance.delete(key)
```

### Parámetros

- `key`
- : La llave de el elemento que se va a remover del objeto `Map`.

### Valor devuelto

`true` si un elemento en el objeto `Map` existía y fué removido, o `false` si el elemento no existe.

## Ejemplos

### Usando delete()

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

console.log(myMap.delete("bar")); // Regresa true. Removido exitosamente.
console.log(myMap.has("bar")); // Regresa false. El elemento "bar" ya no esta presente.
```

## Especificaciones

{{Specifications}}

## Compatibilidad con navegadores

{{Compat}}

## Véase también

- {{jsxref("Map")}}

0 comments on commit 4868ee5

Please sign in to comment.