(f: ArrayFunc<T, U[]>)
| 223 | } |
| 224 | |
| 225 | public flatMap<U>(f: ArrayFunc<T, U[]>): DataArray<U> { |
| 226 | let result = []; |
| 227 | for (let index = 0; index < this.length; index++) { |
| 228 | let value = f(this.values[index], index, this.values); |
| 229 | if (!value || value.length == 0) continue; |
| 230 | |
| 231 | for (let r of value) result.push(r); |
| 232 | } |
| 233 | |
| 234 | return this.lwrap(result); |
| 235 | } |
| 236 | |
| 237 | public mutate(f: ArrayFunc<T, void>): DataArray<T> { |
| 238 | for (let index = 0; index < this.values.length; index++) { |