Skip to content

Instantly share code, notes, and snippets.

@goofmint

goofmint/index.js

Created Feb 8, 2018
Embed
What would you like to do?
Array.prototype.eachWithIndex = function* () {
for (let i = 0; i < this.length; i += 1) {
yield {index: i, value: this[i]};
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment