skaterdav85 Posted February 3, 2010 Share Posted February 3, 2010 whats the difference/advantage of defining a function like this var myFunction = function() { //stuff here} versus function myFunction() { //stuff here} Link to comment Share on other sites More sharing options...
Ingolme Posted February 3, 2010 Share Posted February 3, 2010 You usually would want to use the first method if the function is going to be part of an object: myObject = new Object();myObject.something = function() { // Some code} Though it could still be done the other way too: function __something() { // Some code}myObject = new Object();myObject.something = __something Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.