Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

unique two arrays

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: #unique #arrays
ADD COMMENT
Topic
Name
9+7 =