UNPKG

bbo

Version:

bbo is a utility library of zero dependencies for javascript.

13 lines (10 loc) 283 B
'use strict'; /** * Returns the difference between two arrays, * after applying the provided function to each array element of both. */ function differenceBy(a, b, fn) { var s = new Set(b.map(fn)); return a.map(fn).filter(el => !s.has(el)); } module.exports = differenceBy;