Skip to content

sift

Remove all falsy items from list

62 bytes

Usage

Given a list of items, return a new list with all items that are not falsy.

import * as _ from 'radashi'
const fish = ['salmon', null, false, NaN, 'sockeye', 'bass']
_.sift(fish) // => ['salmon', 'sockeye', 'bass']