This is related to a chapter from beautiful code. And in that chapter I read about the nested ifs.
if
The author was talking about deeply nested if>
if>
You can just break once a part of the validation failed for example.
function validate(){ if(b=="" || b==null){ alert("Please enter your city"); return false; } if(a=="" || a==null){ alert("Please enter your address"); return false; } return true; }