Created
November 26, 2019 16:47
-
-
Save RizkyRajitha/ef461d86fc6116f066fa694d2af5bf08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arr1 = [1, 2, 3, 4]; | |
var arr2 = [7, 8, 9, 1]; | |
loop1: for (let element1 of arr1) {//define a breakpoint | |
for (let element2 of arr2) { | |
console.log(element1, " ", element2); | |
if (element1 === element2) { | |
console.log("duplicate numbers"); | |
break loop1;//if a specific condition is met , break the loop | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment