Back to Lo

Core Rangewithsteps

docs/data/core-rangewithsteps.md

1.53.0199 B
Original Source

Creates a slice progressing from start up to, but not including, end by step. Returns empty if step is 0 or direction mismatches.

go
lo.RangeWithSteps(0, 20, 5)
// []int{0, 5, 10, 15}