Is using a self defined constructor function more expensive than an object literal?
var obj = function(){
this.foo = "bar;
};
The reason why I ask is because, if I declare an object literal as such:
var obj = { foo: bar };
I wonder, if behind the scenes it does the same as:
var obj = new Object();
obj["foo"] = "bar";
If that's the case, I'd assume that they're both approximately as expensive, and choosing one over the other would be trivial (for a case like this).