Click to See Complete Forum and Search --> : exit function
prokhaled
May 20th, 2002, 12:52 PM
How can I exit function in JavaScript. I use (Exit function) in VBScript but what can I use in JavaScript to exit from function
Cander
May 20th, 2002, 12:54 PM
break;
JoshT
May 20th, 2002, 01:33 PM
I'd use "return;".
punkpie_uk
May 21st, 2002, 02:58 AM
what you were returned something from a function though? Wouldn't break; be better for that?
JoshT
May 21st, 2002, 10:32 AM
break exits a loop - return exits a function. IE throws an error if you use break to exit a function...
punkpie_uk
May 21st, 2002, 11:01 AM
ah, good point.
Stiletto
May 24th, 2002, 12:15 AM
Originally posted by JoshT
break exits a loop - return exits a function. IE throws an error if you use break to exit a function...
True. break is for loops and if statments
CiberTHuG
May 24th, 2002, 08:21 AM
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 (http://www.cs.berkeley.edu/~nikitab/courses/cs294-8/hw1.html).
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.