By 08/02/2016 7 Comments

var fName = function() vs function fName()

Example:

var functionOne = function() {
    // Some code
};

function functionTwo() {
    // Some code
}

  • The difference in above two functions are that¬†functionOne is defined at run-time, whereas functionTwo is defined at parse-time for a script block.
  • Following example shows that how these two functions can be written¬†in a program.

Example-1:

// Error
functionOne();

  var functionOne = function() {
   document.write("functionOne");
  };


Example-2:

 // No error
 functionTwo();

 function functionTwo() {
    document.write("functionTwo()");
  }






Posted in: JavaScript, Solutions

Leave your valuable Comment

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .