Answers for ".for loop of index"

2

for of with index

for (const [index, value] of [1, 2, 3, 4, 5].entries()) {
  console.log(index, value);
}
Posted by: Guest on June-18-2021
0

index in for loop

for idx, item in list:
	print(idx + "# " + item)
Posted by: Guest on June-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language