1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
//// [tests/cases/conformance/controlFlow/controlFlowForOfStatement.ts] ////
//// [controlFlowForOfStatement.ts]
let obj: number[];
let x: string | number | boolean | RegExp;
function a() {
x = true;
for (x of obj) {
x = x.toExponential();
}
x; // string | boolean
}
//// [controlFlowForOfStatement.js]
var obj;
var x;
function a() {
x = true;
for (var _i = 0, obj_1 = obj; _i < obj_1.length; _i++) {
x = obj_1[_i];
x = x.toExponential();
}
x; // string | boolean
}
|