Javascript examples for Function:Function Definition
declare functions with function definition and function variable
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/* ww w . ja va 2 s. c o m*/ try { a(); } catch(e) { console.log('problem calling function a(): ' + e); }; try { b(); } catch(e) { console.log('problem calling function b(): ' + e); }; function a(){ console.log('function a() called!'); }; var b = function(){ console.log('function b() called'); }; } </script> </head> <body> </body> </html>