La propiedad de acceso size
devuelve el n煤mero de elementos que hay en el objeto Set
.
Descripci贸n
El valor de size
es un entero que representa cuantas entradas tiene el objeto Set
. La funci贸n de accesso set para size
es undefined
; no se puede cambiar esta propiedad.
Ejemplos
Usando size
var mySet = new Set();
mySet.add(1);
mySet.add(5);
mySet.add("un texto")
mySet.size; // 3
Especificaciones
Especificaci贸n | Estatus | Comentario |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) La definici贸n de 'Set.prototype.size' en esta especificaci贸n. |
Standard | Definici贸n inicial |
ECMAScript Latest Draft (ECMA-262) La definici贸n de 'Set.prototype.size' en esta especificaci贸n. |
Draft |
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!
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Soporte b谩sico | 38 | 19 (19) [1] | 11 | 25 | 7.1 |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | Sin soporte | 38 | 19.0 (19) | Sin soporte | Sin soporte | 8 |
[1] From Gecko 13 (Firefox 13 / Thunderbird 13 / SeaMonkey 2.10) to Gecko 18 (Firefox 18 / Thunderbird 18 / SeaMonkey 2.15 / Firefox OS 1.0.1 / Firefox OS 1.1) la propiedad size fue implementado como un m茅todo Set.prototype.size()
, esto fue cambiado a una propiedad en versiones posteriores conforme la especificaci贸n ECMAScript 6 (bug 807001).