Create a function by assign the function to a value - Javascript Function

Javascript examples for Function:Function Variable

Description

Create a function by assign the function to a value

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(){//from  w  w  w. j  a v  a  2s .  c  o m
hello = function() { // this is the same as function hello() { }
    console.log('hi');
};
hello(); // call it like a normal function :)
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials