Files
lo/docs/data/core-drop.md
T
Yuliya b6154d0f8d feat: add Take, TakeWhile, FilterTake, Window, and Sliding functions (#760)
* feat: add Take, TakeWhile, FilterTake, Window, and Sliding functions

Add five new slice manipulation functions with tests, examples, and documentation.

* improve Take function safety and add benchmarks

* rename FilterTake to TakeFilter and add README docs

* remove Window and Sliding benchmarks

* apply gofmt and fix linter errors

* apply gofmt and fix linter errors
2026-01-07 17:28:08 +01:00

593 B

name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
name slug sourceRef category subCategory playUrl variantHelpers similarHelpers position signatures
Drop drop slice.go#L441 core slice https://go.dev/play/p/JswS7vXRJP2
core#slice#drop
core#slice#dropright
core#slice#dropwhile
core#slice#dropbyindex
core#slice#slice
core#slice#droprightwhile
core#slice#cutprefix
core#slice#take
core#slice#takewhile
170
func Drop[T any, Slice ~[]T](collection Slice, n int) Slice

Drops n elements from the beginning of a slice.

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