Created
March 23, 2016 02:16
-
-
Save rlucha/ce617565f7bb831d58d1 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 takeWhile(conditionFn, iterable) { | |
let result = [] | |
let value = take(1, iterable) | |
while (conditionFn(value)) { | |
result = result.concat(value) | |
value = take(1, iterable) | |
} | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment