[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Global_Objects/Set/delete [Back]  [Original]

Set.prototype.delete() - JavaScript | MDN

Esta pgina ha sido traducida del ingls por la comunidad. Aprende ms y nete a la comunidad de MDN Web Docs.

View in English Always switch to English

Set.prototype.delete()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since julio de 2015.

El mtodo delete() remueve el elemento especificado del objeto Set.

In this article

Sintaxis

mySet.delete(value);

Parametros

valor

Requerido. El valor del elemento a remover del objeto Set.

Valor de retorno

true si el elemento ha sido removido exitosamente en el Set; de otra manera retorna false.

Ejemplos

Usando el mtodo delete

js
var mySet = new Set();
mySet.add("foo");

mySet.delete("bar"); // Retorna false. No hay elemento "bar" para ser removido.
mySet.delete("foo"); // Retorna true.  Removido exitosamente.

mySet.has("foo"); // Retorna false. El elemento "foo" ya no est presente.

Especificaciones

Specification
ECMAScript 2027 LanguageSpecification
# sec-set.prototype.delete

Compatibilidad con navegadores

Ver tambin


Web Proxy Viewer  |  New URL  |  Original Page