I have multiple (10) if statemnets stacked in a function, and need something like this:
$len=$("#user").val().length;
if($len == 0) { do something and then - stop, exit, break ... whatever)
So, if $len is 0 – do something and – dont check anything more. Just exit from the execution.
You can use return statement but it will take the execution control at end of function and skip all the statements between. or use if-else block or use switch.
Use if-else
Using switch