Cast declaration variable inside for of loop
ref TypeScript casting arrays
let array1 : Array<string | number> = [];
array1.push('abc', 9, 'def', 10);
for (let a of array1 as Array<string> ){
console.log(a);
}
ref TypeScript casting arrays
let array1 : Array<string | number> = [];
array1.push('abc', 9, 'def', 10);
for (let a of array1 as Array<string> ){
console.log(a);
}