Concatenates two arrays, removing duplicates in the process and returns one array with unique values.
var concat = require('unique-concat'); var res = concat([ 1, 2, 3 ], [ 1, 2, 3, 4, 5, 6]) console.log(res); // => [1, 2, 3, 4, 5, 6]
npm install unique-concat
NoteWorks only with types that can be properly hashed, which means that they need to have a sensible
Types that work as expected:
Types that work with caveats:
float(if one float is part of the array, all numbers are converted to string)
Types that don't work:
obj.toString === '[ object ]'for all objects.
For more information see tests