DEV Community

loading...

Discussion on: Daily Coding Puzzles - Nov 4th - Nov 9th

Collapse
clandau profile image
Courtney
function array_diff(a, b) {
  let counter = {};
  for(let i of b) {
    counter[i] = true;
  }
  let result = a.filter(item => counter[item] !== true);
  return result;
}