Documentation ¶
Index ¶
- func AppendAt[T arrTypes](a []T, i int, v []T) []T
- func Filter[T arrTypes](a []T, f func(T) bool) []T
- func In[T arrTypes](arr []T, key T) (exists bool, i int, val T)
- func InsertAt[T arrTypes](a []T, i int, v T) []T
- func Map[T arrTypes](arr []T, f func(T) T) []T
- func Reduce[T arrTypes](a []T, f func(T, T) T) T
- func RemoveAt[T arrTypes](a []T, i int) []T
- func RemoveElem[T arrTypes](a []T, searchKey T) []T
- func Replace[T arrTypes](arr []T, key T, replacer T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendAt ¶
func AppendAt[T arrTypes](a []T, i int, v []T) []T
AppendAt appends the newValue at the index i.
func Filter ¶
func Filter[T arrTypes](a []T, f func(T) bool) []T
Filter returns a new array containing only the elements that satisfy the predicate f.
func InsertAt ¶
func InsertAt[T arrTypes](a []T, i int, v T) []T
InsertAt inserts the newValue at the index i.
func Map ¶
func Map[T arrTypes](arr []T, f func(T) T) []T
Map applies the function f to each element of the array and returns the result.
func Reduce ¶
func Reduce[T arrTypes](a []T, f func(T, T) T) T
Reduce applies the function f to each element of the array and returns the result.
func RemoveAt ¶
func RemoveAt[T arrTypes](a []T, i int) []T
RemoveAt removes the element at the index i.
func RemoveElem ¶ added in v1.0.1
func RemoveElem[T arrTypes](a []T, searchKey T) []T
RemoveElem removes the first element in the array that equals the searchKey.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.