Closed
Description
Current behaviour: flat() is returning array with zero length
Expected behaviour: flat() should make all items flatten, so it should be [1,3,2,3], so length = 4
export function getData(): void {
let arr: f32[][] = [[1], [2]]
let flattenArray = arr.map<f32[]>(nestedArray => {
nestedArray.push(3)
trace("nestedArray.length", 1, nestedArray.length)
return nestedArray
}).flat()
trace("flattenArray.length", 1, flattenArray.length)
}
Interesting facts:
- if initial input will be changed from
let arr: f32[][] = [[1], [2]]
tolet arr: f32[][] = [[1]]
, then Array#flat is working correctly - of course when push from 5 line is removed, then Array#flat is also working correctly