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)
var foo= $(function(){
}
3)
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