Example 1 — Official: One Level Only
Deeper nests remain after a single flatten.
_.flatten([1, [2, [3, [4]], 5]]);
// → [1, 2, [3, [4]], 5] How It Works
- Source. Top level has
1and one nested array. - Unwrap once. That nested array expands to
2,[3,[4]],5. - Stop.
[3,[4]]is still an array element — not unwrapped again. - Rule. Shallow flatten ≠ recursive flatten.

