Created
February 8, 2018 06:26
-
-
Save goofmint/9416aea3652eee144ab00415d7b8474f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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