declare functions with function definition and function variable - Javascript Function

Javascript examples for Function:Function Definition

Description

declare functions with function definition and function variable

Demo Code

ResultView the demo in separate window

<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>

Related Tutorials