How can I exit function in JavaScript. I use (Exit function) in VBScript but what can I use in JavaScript to exit from function
Printable View
How can I exit function in JavaScript. I use (Exit function) in VBScript but what can I use in JavaScript to exit from function
break;
I'd use "return;".
what you were returned something from a function though? Wouldn't break; be better for that?
break exits a loop - return exits a function. IE throws an error if you use break to exit a function...
ah, good point.
True. break is for loops and if statmentsQuote:
Originally posted by JoshT
break exits a loop - return exits a function. IE throws an error if you use break to exit a function...
And even then, there are better ways to exit the control structure without using "break". And if you think break is a good idea, just ask AT&T about January 15.