Created
March 23, 2016 02:10
-
-
Save rlucha/fcf4e51e58aaa0ab500e 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
function take(n, iterable) { | |
let result = [], i = 0 | |
while (i < n) { | |
result.push(iterable.next().value) | |
i++ | |
} | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment