func Map[T any, R any](collection []T, iteratee func(item T, index int) R) []R
Transforms each element in a slice to a new type using a function. Takes both the element and its index, making it useful for transformations that need positional context.
// Basic type transformationtransformed:=lo.Map([]int64{1,2,3,4},func(xint64,indexint)string{returnstrconv.FormatInt(x,10)})// transformed: []string{"1", "2", "3", "4"}