Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js for of array with index

for (const [index, value] of [1, 2, 3, 4, 5].entries()) {
  console.log(index, value);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #array #index
ADD COMMENT
Topic
Name
2+9 =