pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Set/size

s://developer.mozilla.org/favicon.ico" />

Dieser Inhalt wurde automatisch aus dem Englischen übersetzt, und kann Fehler enthalten. Erfahre mehr über dieses Experiment.

View in English Always switch to English

Set.prototype.size

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since Juli 2015.

Die size Zugriffseigenschaft von Set-Instanzen gibt die Anzahl der (einzigartigen) Elemente in diesem Set zurück.

Probieren Sie es aus

const set = new Set();
const object = {};

set.add(42);
set.add("forty two");
set.add("forty two");
set.add(object);

console.log(set.size);
// Expected output: 3

Beschreibung

Der Wert von size ist eine Ganzzahl, die angibt, wie viele Einträge das Set-Objekt hat. Eine Set-Accessor-Funktion für size ist undefined; Sie können diese Eigenschaft nicht ändern.

Beispiele

Verwendung von size

js
const mySet = new Set();
mySet.add(1);
mySet.add(5);
mySet.add("some text");

console.log(mySet.size); // 3

Spezifikationen

Specification
ECMAScript® 2026 Language Specification
# sec-get-set.prototype.size

Browser-Kompatibilität

Siehe auch

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy