My faunction does not work correctly!

Hallo guys i am going to put a picture and codes for a Function i have.

I explained all the function and what it will do in the picture.

RED line = array argument for the function.
YELLOW line = b argument for the function.
GREEN line = …args argument for the function.

As i explained in the pic the function should compare all the arguments with the ( array ) argument and if they are equal it should remove them and return the new array.

It works fine but as it can be seen in the console. It removes all the values correctly except the first value of (…args) argument !!!

I do not know how to fix that so i would be happy to get your helps !!

the pic is :

my code is :

This function should compare the arguments.
Whenever the arguments ( b, ...args) are equal to array, then it have to remove them and return the array without those values.
array = the first argument which usually is a an Array.
b = the second argument.
args = all the arguments after (b) which all be concated to an array.
function mn (array, b, ...args){
//result gets back the new array and i will be showing it on the screen.  
  var result = array;
// argsValue gets all the values in args.
    var argsValue = args.values();
// the for loop will loop into every index of the argsValue
  for (let argsValues of argsValue){  
//this for loop loop into every index of the given array and returns their value.
  for(let i = 0; i < array.length; i++){
    let equal = array[i]; // this variable holds the values of every index.
 // This if statment checks if the values are equal then it will remove them in the array. when not it will continue
    if(equal === b || equal === argsValues){
    }else {
mn([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3, 4, 5, 6, 7)
In the conclusion the function works fine and removes the equal values, but as marked it does not remove the first value after (b) argument !!! that is the bug which i want to fix

You are iterating over the array which you are modifying. When first element is removed (3 in this case, when i == 2) the next one takes that place (4) and now that element has index 2 in the array. Loop moves to the next i -> i == 3 what results in missing checking one of the element in the array.

so now i have to change the iterating thing !! should i make two iterating statments ?