This array contains 1,5,
let numberArray = [1,5];
I'm trying to print numbers from 1 to 280 except for the values inside the numberArray,
for (let i = 1; i < 281; i++) {
numberArray.forEach((number) => {
if (number != i) {
console.log(i);
}
});
}
I'm expecting the result to be 2,3,4,6,7...280 without printing 1 and 5 in this case. But I get like this,
It prints 2 times each number except 1 and 5. I want to completely omit the values inside the numberArray and print the other values. Really appreciate it if somebody could point me to the bug. Thanks.
