kidoOooOoooOOom

IT系で開発やってます

今日のunderscore.js

unionを見かけた。

union_.union(*arrays)
Computes the union of the passed-in arrays: the list of unique items, in order, that are present in one or more of the arrays.

_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
=> [1, 2, 3, 101, 10]

重複除いてunique要素で配列返す。