From: Andrew Poulos on 23 Jan 2010 17:19 If I have this function fun() { // evaluate something return something; } try { var foo = fun(); } catch (err) { alert("fun error"); } and there's an error in the function 'fun' does the try/catch catch it? Andrew Poulos
From: Stevo on 23 Jan 2010 17:57 Andrew Poulos wrote: > If I have this > > function fun() { > // evaluate something > return something; > } > > try { > var foo = fun(); > } catch (err) { > alert("fun error"); > } > > and there's an error in the function 'fun' does the try/catch catch it? > > Andrew Poulos Yes. btw, it's probably quicker to try it than ask the question ;-)
From: Thomas 'PointedEars' Lahn on 23 Jan 2010 18:36 Andrew Poulos wrote: > If I have this > > function fun() { > // evaluate something > return something; > } > > try { > var foo = fun(); > } catch (err) { > alert("fun error"); > } > > and there's an error in the function 'fun' does the try/catch catch it? Depends on the implementation and the error. PointedEars -- Use any version of Microsoft Frontpage to create your site. (This won't prevent people from viewing your source, but no one will want to steal it.) -- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)
|
Pages: 1 Prev: Passing primitives by reference, part 2 Next: How can I get visible area on Android browser? |