Skip to content

Instantly share code, notes, and snippets.

@ilearnjavascript
Created March 27, 2019 23:22
Show Gist options
  • Save ilearnjavascript/54ef6d40529d3ccba6b40986f1b6896c to your computer and use it in GitHub Desktop.
Save ilearnjavascript/54ef6d40529d3ccba6b40986f1b6896c to your computer and use it in GitHub Desktop.
es6 - new methods - 11.js
var arr = [5, 1, 10, 8];
for (var entry of arr.entries()) {
console.log(entry);
}
// outputs:
// (2) [0, 5]
// (2) [1, 1]
// (2) [2, 10]
// (2) [3, 8]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment