Your logic is pretty far off. Let me help you by writing out the algorithm in plain language. Then you can take it and see if you can code it.
Iterate through each element in the first argument (arr) of the function and if an element in arr is not one of the other function arguments (extra arguments after the first arr argument), then push the arr element into newArr. After iterating through all elements of arr, return newArr.
The part you seem to be having trouble with is the " if an element in arr is not one of the other function arguments (extra arguments after the first arr argument)". One approach to this is to create an inner loop which iterates on the extra numbers after the first arr argument. Before this inner loops begins, you will need an extra variable (let’s call it found) which will hold the Boolean value false. This false represents the fact that the current number in arr has not been found. We assume false and will test if we do find it. When we do find it, we will assign the value true to found and then stop iterating (learn about the break statement) in the current inner loop. Right after the inner for loop is an if statement asking whether found is equal to false. If it is, then you can push the arr element into newArr, because it was not “found” to be one of the extra number after the arr argument.
Take a shot at the logic I have provided you above. If you get stuck, post your most recent code and I will give you a few more pointers. I am trying to not just give you the solution.
By the way, when you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (
</>) will also add backticks around text.