Example 1 — Official Docs Merge
The classic Underscore example — three arrays into one unique list.
_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
// → [1, 2, 3, 101, 10] How It Works
- First array. Keeps
1,2,3in order. - Second array. Adds new values
101and10; skips repeats of2and1. - Third array. Only
2and1— both already seen, so nothing new. - Result. Unique values in first-seen order:
[1, 2, 3, 101, 10].

