Sets
Added in ES 2015.
A set is a specialised array that can only contain one instance of each unique item.
You can create a new instance of Set by passing a flat array as an argument.
const mySet = new Set()
mySet.add('value')
const myArray = ['value1','value2','value2'];
mySet = new Set(myArray)
// Set {'value1', 'value2'}
Methods
Method | Mutates | Description |
add | ||
clear | ||
delete | ||
entries | ||
has |
© 2023 Better Solutions Limited. All Rights Reserved. © 2023 Better Solutions Limited TopPrevNext