Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

for of loop get index in javascript

const names=["shirshak","Bigyan","Savyata"];
for(let name of names){
console.log(name); //output all name 
console.log(names.indexOf(name)); // index 0,1,2
}
Source by flaviocopes.com #
 
PREVIOUS NEXT
Tagged: #loop #index #javascript
ADD COMMENT
Topic
Name
2+4 =