Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

for of get index

for (const v of ['a', 'b', 'c']) {
  console.log(v)
}

// get index
for (const [i, v] of ['a', 'b', 'c'].entries()) {
  console.log(i, v)
}
Source by flaviocopes.com #
 
PREVIOUS NEXT
Tagged: #index
ADD COMMENT
Topic
Name
5+2 =