Set.prototype.delete()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
El método delete()
remueve el elemento especificado del objeto Set
.
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 método 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® 2025 Language Specification # sec-set.prototype.delete |
Compatibilidad con navegadores
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
delete |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.