Created
October 26, 2019 18:20
-
-
Save ooade/1227f07841157370a8e22f31df0990b4 to your computer and use it in GitHub Desktop.
Exactly like python's enumerate function
This file contains hidden or 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
let enumerate = string => string.split('').map((v, i) => [i, v]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To be used with
for..of
like: