Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript unique array

const mySet = new Set([1,2])
const additionalSet = [5,2,6]
mySet = new Set([...mySet, ...additionalSet]) // {1,2,5,6}
array = [...new Set([...mySet, ...additionalSet])] // [1,2,5,6]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #unique #array
ADD COMMENT
Topic
Name
6+4 =