I'm wondering what the difference, or if any, the following JS is for building up an object. Is it a style thing/standards thing? If so, which is most common?
Example 1:
var MyNamspace = {
options: { test: 10 },
someFunction: function() { alert("Hello"); }
}
Example 2:
var MyNamespace = {};
MyNamespace.options = { test: 10 };
MyNamespace.someFunction = function() { alert("Hello"); }
Thanks.