Parameters
- arr: readonly T[] | undefined
- callbackfn: (value: T, index: number, arr: readonly T[]) => U | undefined
OptionalthisArg: any
Returns readonly Defined<U>[] | undefined
the original array if callbackfn returns the same value for all items, otherwise a new array with the mapped items.
Lazy filterMap that avoids creating a new array when possible.