I'm used to create objects in JavaScript using this syntax :
var myObject = new function() {
this.myMethod = function() {
}
}
Wich I find more simple to read than the "closure syntax" :
var myObject = (function() {
return {
myMethod: function() {
}
}
})();
But i've heard that using "new" was a bad thing in JavaScript, and codes i've seen generally use the closure syntax.
Some of you would be able to explain why the closure syntax get over the new syntax ?