Possible Duplicate:
Javascript object creation using literals vs custom constructor functions
Function vs. Object Literal Notaion - Which is better, or is it a matter of preference?
Could anyone enlighten me what is the difference between below two ways of creating objects in JavaScript or more specifically drawbacks/advantages of them:
Function Foo() {
function bar () {...}
}
And
var Foo = {
bar : function() {}
}
Also since in latter way, there is no this
keyword, how can I make it object instance member ?