Don’t iterate over arrays using for...in. That syntax is for iterating over the properties of an object, which isn’t what you’re after.
As for your actual question, you can use the continue:
var y = [1, 2, 3, 4];
for (var i = 0; i < y.length; i++) {
if (y[i] == 2) {
continue;
}
console.log(y[i]);
}
This will print:
1
3
4
Reference Link – https://stackoverflow.com/questions/15034763/how-to-skip-to-next-in-javascript-in-a-for-in-with-a-while-inside


















