Javascript examples for Statement:throw
Use throw statement as return
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <script type="text/javascript"> function test1(){/* ww w.j av a 2 s .c o m*/ test2(); test3(); } function test2(){ console.log(2); throw ''; test4(); test5(); } function test3(){ console.log(3); } function test4(){ console.log(4); } function test5(){ console.log(5); } test1(); </script> </body> </html>