Why does this uneventful map change the type of the array?
I am doing a more complicated map than this but the goal is to keep the type the same through the map.
const x: type1[] | type2[]=[]; // x has type type1[] | type2[]
const y = x.map(item=>item); // y has type (type1 | type2)[]
I am using typescript 4.3.5.