Why is correct the way it is written in the course?
In the Form Validation example of the JS course it uses the following code: function validate() { var n1 = document.getElementById("num1"); var n2 = document.getElementById("num2"); if(n1.value != "" && n2.value != "") { if(n1.value == n2.value) { return true; } } alert("The values should be equal and not blank"); return false; } For my understanding, programming is kind of linear (line two comes after line one unless you call it first). So, in that function there are two IF statements. In case both statements are TRUE the RETURN value is set to TRUE as well. So far so good. Yet, why is the second part inside the function not being executed after the IF conditions are TRUE? Shouldn't it be executed anyway since there is no ELSE statement telling the program to not execute the remaining code after the IF statement is TRUE? I am sorry if this questions seems kind of basic to you guys.