documentcloud/underscore — Issue #341: Was _.union() intended to use _.flatten()?
Author: aveic
Created: 2011-10-19 13:07:49+00:00
State: open

I saw that ._union() uses _.uniq(_.flatten(arguments));
It means it makes the union of the flatten versions of the given arrays.

But i thought _.union([1, 2], [3, [4, 5]], [2, [4, 5]]) will produce [1, 2, 3, [4, 5]].

Maybe it's worse having two versions of _.union()? Like _.flattenUnion() and simple level-1 _.union()?