whats the best practice to use these?
var x = { a: 'a', eat: function() { }, ... }
vs
var x = function() { var a = 'a'; this.eat = function() { }}
the above needs to be initiated:
new x();
can someone help me explain the importance of the two, and which one is preferred choice within the oop community? any word of wisdom would help. i also did some research but nothing came up. much thought is appreciated.