Add flatSift
function
#266
aleclarson
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Use
flatSift
to efficiently flatten an array that may contain falsy values as well as nested arrays.Example usage
Preliminary implementation
This implementation is not yet type-safe.
Todo
sift(arrays).flat()
Naming
I chose
flatSift
since this function combines the functionality offlat
andsift
into a single efficient loop.Open to other naming suggestions.
Beta Was this translation helpful? Give feedback.
All reactions