Sets

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


MethodMutatesDescription
add  
clear  
delete  
has  



© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext