Petlja for u TypeScript-u
U petlji for potrebno je navesti tip
brojača:
for (let i: number = 0; i <= 10; i++) {
console.log(i);
}
Prepišite sledeći kod koristeći TypeScript:
let res = 0;
for (let i = 0; i < 100; i++) {
res += i;
}
console.log(res);