Junior — Senior
Removing elements from the first array that are found in the second, while preserving order
livecode
Task condition
Given two arrays — a and b. Implement a function that compares them and removes from array a all values that are present in array b, while keeping the order of the remaining elements in a unchanged.
// Examples:
// console.log(function([0, 2, 2, 2, 4], [2])); // [0,4]
// console.log(function([1, 2, 2], [1])); // [2,2]
// console.log(function([0, 2, 3], [1, 2])); // [0,3]