UNPKG

lenye_base

Version:

基础方法

12 lines (10 loc) 280 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;