Files
lo/docs/data/core-range.md
T
Samuel Berthe fa095e4b4f fix(doc): fix go playground demo URL (#832)
* fix(doc): fix go playground demo URL

* fix(doc): add more go playground demo URL
2026-03-06 00:09:59 +01:00

560 B

name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
name slug sourceRef category subCategory playUrl variantHelpers similarHelpers position signatures
Range range math.go#L9 core math https://go.dev/play/p/rho00R0WuHs
core#math#range
core#math#rangefrom
core#math#rangewithsteps
core#math#times
core#slice#repeat
core#slice#repeatby
0
func Range(elementNum int) []int

Creates a slice of integers of the given length starting at 0. Negative length produces a descending sequence.

lo.Range(4)
// []int{0, 1, 2, 3}

lo.Range(-4)
// []int{0, -1, -2, -3}