How do I make this if statement stop after the correct answer is chosen? Do I need to change it to if else, or is there something else I can try?
if
if (!arraysEqual(answerKey, answers)) {
alert('Please Try Again');
return false;
}
if (arraysEqual(answerKey, answers)) {
$("#bin ol").append('<a href="index.html" name="modal"><img id="correct" src="images/visSelect/seq_correct.png"></a>');
return false;
}
});
if else (updated)
if (arraysEqual(answerKey, answers)) {
$("#bin ol").append('<a href="index.html" name="modal"><img id="correct" src="images/visSelect/seq_correct.png"></a>');
return false;
}else{
alert('Please Try Again');
return false;
}
if..elselooks better in your case for the case that you callarraysEqualstwice.