UNPKG

bbo

Version:

bbo is a utility library of zero dependencies for javascript.

12 lines (10 loc) 276 B
/** * Returns the difference between two arrays. * Create a Set from b, then use Array.prototype. * Filter() on a to only keep values not contained in b. */ function difference(a, b) { var s = new Set(b); return a.filter(x => !s.has(x)); } export default difference;