Skip to content

Instantly share code, notes, and snippets.

@rlucha
Created March 23, 2016 02:16
Show Gist options
  • Save rlucha/ce617565f7bb831d58d1 to your computer and use it in GitHub Desktop.
Save rlucha/ce617565f7bb831d58d1 to your computer and use it in GitHub Desktop.
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