I'm a beginner in javascript programming and I notice that there are some cases where a function is defined as
myfunc : function() {...},
and other cases where it is defined as:
function myfunc(){...}
Can someone explain what the difference is, and when should one be used over the other.