I have problems with exercise 04 at The Odin Project JS Fundamentals. Implement a function that takes an array and some other arguments then removes the other arguments from that array:
removeFromArray([1, 2, 3, 4], 3); // should remove 3 and return [1,2,4]
I found a solution and tested it successful on my chrome-console, but it fails every test in the terminal (with npm test ...). I don`t know whats wrong with the code. My solution:
const removeFromArray = function(arr, ...args) {
let a = arr;
let b = args;
let c = a.filter(d => !b.includes(d));
console.log(c);
};
I used the variables a, b, c, d to make it more understandable for myself. Could this be the problem?
Thank you!