i have different people write function in js different way. here i am giving few sample code. so some one help me to understand why people write function different way and their significance.
1) function foo()
{
}
2) 3) }
Code
var foo= $(function(){
}Code
foo : function() {so please see the above code and tell me the significance of above different approach of writing javascript code. looking for details discussion with sample code. thanks

PradeepRank #6,279 · 271 reputationPosted Mar 4, 2015, 2:43 AM EST
Go through this link . it will help you.