What causes the array type to change in this unremarkable map?
Although I'm working on a more complex map, my ultimate goal is to maintain consistency with the array's type throughout the process.
const x: type1[] | type2[]=[]; // x is of type type1[] | type2[]
const y = x.map(item=>item); // y becomes type (type1 | type2)[]
I am specifically using TypeScript version 4.3.5 for this project.