I have been trying to write a simple for loop like below in typescript :
j:any;
x=[1,2,3,4,5,6,7];
for(j in x){
console.log(x[j]);
}
I get so much errors even when i use this keyword
1.'=' expected.
2. Cannot find name 'j'.
3.Module parse failed:
You may need an appropriate loader to handle this file type.
| this.x = [1, 2, 3, 4, 5, 6, 7]; | } |
PlanningComponent.prototype.for = function (let) { | if (let === void 0) { let = j in this.x; } | console.log(this.x[j]);
4.Duplicate identifier j
5.Unexpected token.
Please correct me where i went wrong.