Example 1 — Official: One Argument
Pass only end; start defaults to 0.
_.range(4);
// → [0, 1, 2, 3]
_.range(0);
// → [] How It Works
- Shorthand. One number is treated as
end. - Start at 0. Counts
0 … end-1. - Exclusive end.
4itself is not included. - Empty.
_.range(0)has nothing before the end →[].

