Skip to content

Instantly share code, notes, and snippets.

@AdrianSkar
Created May 28, 2021 14:37
Show Gist options
  • Save AdrianSkar/79eb7f49c490c648be47f46940086aa5 to your computer and use it in GitHub Desktop.
Save AdrianSkar/79eb7f49c490c648be47f46940086aa5 to your computer and use it in GitHub Desktop.
[JS] Array.entries()
const arr = ['html', 'css', 'js'];
const iter = arr.entries();
for (let value of iter) {
console.log(value); // [ 0, 'html' ], [ 1, 'css' ], [ 2, 'js' ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment