for (const [index, value] of ['a', 'b', 'c'].entries()) {
console.log(index, value)
}
/*
0 "a"
1 "b"
2 "c"
*/
Last active
January 10, 2021 19:29
-
-
Save zmts/8468c3500b0866c0fb3ca09e7cf7e5bc to your computer and use it in GitHub Desktop.
Get index in for of
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment