I've got this code:
var x = function(){
    return {
        x: function(name){
            this.name = name;
        }
    }
}();
var z = new x.x ("jaga");
console.log(z);
and my question is why do I need to use:
}();
at the end of function to make it a constructor?
 
    