How to continue outer loop in JavaScript

1 Answer

0 votes
const a = [4, 5, 1, 1, 6, 7, 0, 1, 1, 1, 8];
const b = [9, 1, 2];
        
OUTER:
for (let i in a) {
   for (let j in b) {
      if (a[i] === b[j]) {
         continue OUTER;
      }
   }
   console.log(a[i]);
}


/*
run:

4
5
6
7
0
8

*/

 



answered Apr 24, 2025 by avibootz

Related questions

1 answer 266 views
1 answer 217 views
217 views asked Apr 25, 2025 by avibootz
3 answers 353 views
2 answers 238 views
1 answer 239 views
239 views asked Apr 24, 2025 by avibootz
2 answers 323 views
323 views asked Apr 24, 2025 by avibootz
...