Function Declaration vs Function Expression

You guys several times will have seen the function in two syntax.

 

    1)Function Declaration

  1. (adsbygoogle = window.adsbygoogle || []).push({});
  2.  
  3. function func_name(arg_1, arg_2,..., arg_n){
  4.     .............
  5.     ...........
  6. }

    2)Function Expression

  1. var func_name;
  2. func_name=function(){
  3.     ....................
  4.     .............
  5. };
  6.  

 

Here are the differences

 

 

 

Leave a Reply