Set.prototype.has()
El método has()
retorna un booleano indicando si el elemento especificado existe en el objeto Set
o no.
Syntaxis
mySet.has(value);
Parametros
- valor
- Requerido. El valor del cual se probará su presencia en el objeto
Set
.
Valor de retorno
- Booleano
- Retorna
true
si el elemento con el valor especificado existe en el objetoSet
; de otra manera retornafalse
.
Ejemplos
Usando el método has
var mySet = new Set();
mySet.add("foo");
mySet.has("foo"); // retorna true
mySet.has("bar"); // retorna false
Especificaciones
Especificación | Estado | Comentario |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) La definición de 'Set.prototype.has' en esta especificación. |
Standard | Definición inicial. |
ECMAScript (ECMA-262) La definición de 'Set.prototype.has' en esta especificación. |
Living Standard |
Compatibilidad de navegadores
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help! (en-US)
Característica | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Soporte básico | 38 | 13.0 (13.0) | 11 | 25 | 7.1 |
Característica | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Soporte básico | Sin soporte | 38 | 13.0 (13.0) | Sin soporte | Sin soporte | 8 |