UNPKG

rambdax

Version:

Extended version of Rambda - a lightweight, faster alternative to Ramda

9 lines (6 loc) 247 B
import { filter } from './filter.js' import { includes } from './includes.js' export function intersection(listA, listB){ if (arguments.length === 1) return _list => intersection(listA, _list) return filter(x => includes(x, listA), listB) }