Example 1 — Official: Stop Only
One argument is the exclusive stop; start defaults to 0.
_.range(10);
// → [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] How It Works
- One argument. Underscore treats
10asstop. - Start at 0. The first value pushed is
0. - Step by 1. Default ascending step fills
1…9. - Stop excluded.
10is never added — length is10.

