rambdax
Version:
Extended version of Rambda - a lightweight, faster alternative to Ramda
16 lines (13 loc) • 341 B
JavaScript
import { includes } from './includes'
import { reduce } from './reduce'
export function without(matchAgainst, source){
if (source === undefined){
return _source => without(matchAgainst, _source)
}
return reduce(
(prev, current) =>
includes(current, matchAgainst) ? prev : prev.concat(current),
[],
source
)
}