Js array subscript check different execution, the same also executed?

Why is it still executed?

is also executed if the value of the num array is the same as that of the header subscript.
let num = [1,2] //
let header = ["en","xx","vv","ccc","ccx"]
for(let i=0;i<header.length;iPP) {
    num.forEach((el) => {
        if(i !== el) {
            console.log(header[i])
        }
    })
}
Jul.20,2021

does not execute
num.forEach () performs a different

by comparing it with all the values in num each time.
for(let i=0;i<header.length;iPP) {
        if(num.indexOf(i) === -1) {
            console.log(header[i])
        }
}

you mean this, don't you?

Menu