UNPKG

cpt-waffle-lotide

Version:
17 lines (14 loc) 363 B
const without = (source:any[], itemsToRemove:any[]):any[] => { interface Hash { [key: string]: any }; const obj: Hash = {}; itemsToRemove.forEach((item:any) => { obj[item] = item; }) const result:any[] = []; source.forEach((item:any) => { if (obj[item] && obj[item] === item) return; result.push(item); }) return result; } export default without;