I know you can do something like this:
var obj = {stuff: 'blah', work: function foo () {return 1}; place: 'bar'};
But you can also do this, I believe:
var obj = function ()
{
this.stuff = 'blah',
this.work = function foo () {return 1},
this.place = 'bar'
};
So is there a difference between creating an object with a function as opposed to object notation? When would I use one over the other?