I am trying to code a game of snap in JS. When the cards are the same, the console will log 'SNAP!' OK, but it will not stop. Am I adding the break; in at the wrong part?
for (mattCounter = 0; mattCounter < mattDeck.length; mattCounter++) {
for (jamesCounter = 0; jamesCounter < jamesDeck.length; jamesCounter++) {
if (mattDeck[mattCounter] === jamesDeck[jamesCounter]) {
console.log('SNAP!');
break;
} else {
console.log('Go again...');
}
}
};