Set - JavaScript | MDN

developer.mozilla.org

Tin mới

HTML: Markup language

See all HTML references

Date & time formats

See all HTML guides

CSS: Styling language

See all CSS references

See all CSS guides

Centering an element

JavaScript: Scripting language

Standard built-in objects

Expressions & operators

Statements & declarations

See all JavaScript references

Control flow & error handing

Loops and iteration

Working with objects

See all JavaScript guides

Web APIs: Programming interfaces

Service worker API

Using the Web animation API

Using the Fetch API

Working with the History API

Using the Web speech API

All web technology

Progressive web apps

Learn web development

Getting started modules

Structuring content with HTML module

CSS styling basics module

Dynamic scripting with JavaScript module

Border-image generator

Border-radius generator

Box-shadow generator

Color format converter

Array.prototype.includes

The has method checks if a value is in the set, using an approach that is, on average, quicker than testing most of the elements that have previously been added to the set. In particular, it is, on average, faster than t

A.symmetricDifference(B)

A.symmetricDifference(B)

A.isDisjointFrom(B)

A.isDisjointFrom(B)

[Symbol.iterator]()

Note: The set-like protocol invokes the keys() method instead of [Symbol.iterator]() to produce elements. This is to make maps valid set-like objects, because for maps, the iterator produces entries but the has() method

GPUSupportedFeatures

Browser Set-like objects (or "setlike objects") are Web API interfaces that behave in many ways like a Set.

ViewTransitionTypeSet

Set[Symbol.species]

The constructor function that is used to create derived objects.

Set.prototype.constructor

The constructor function that created the instance object. For Set instances, the initial value is the Set constructor.

Set.prototype.size

The constructor function that created the instance object. For Set instances, the initial value is the Set constructor.

[Symbol.toStringTag]

The initial value of the [Symbol.toStringTag] property is the string "Set". This property is used in Object.prototype.toString().

Object.prototype.toString()

The initial value of the [Symbol.toStringTag] property is the string "Set". This property is used in Object.prototype.toString().

Set.prototype.add()

Inserts the specified value into this set, if it is not already present.

Set.prototype.clear()

Inserts the specified value into this set, if it is not already present.

Set.prototype.delete()

Inserts the specified value into this set, if it is not already present.

Set.prototype.difference()

Inserts the specified value into this set, if it is not already present.

Set.prototype.entries()

Inserts the specified value into this set, if it is not already present.