Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

for of loop in ts with index

const someArray = [9, 2, 5];
someArray.forEach((value, index) => {
    console.log(index); // 0, 1, 2
    console.log(value); // 9, 2, 5
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #loop #ts #index
ADD COMMENT
Topic
Name
2+7 =