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 140 views
1 answer 102 views
102 views asked Apr 25, 2025 by avibootz
3 answers 169 views
2 answers 110 views
1 answer 143 views
143 views asked Apr 24, 2025 by avibootz
2 answers 156 views
156 views asked Apr 24, 2025 by avibootz
...