René Nyffenegger's collection of things on the web | |
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
|
throw [JavaScript snippet] | ||
function throw_if_2(a) { if (a == 2) { throw "a == 2"; } return a*2; } function main() { txt_out('bla'); var e = "EEEE"; try { throw_if_2(2); } catch (e) { txt_out("caught: " + e); } txt_out("e after catching: " + e); }
See also other Javascript snippets
|