I have read that creating a namespace for JavaScript projects helps to reduce conflicts with other libraries. I have some code with a lot of different types of objects for which I have defined constructor functions. Is it good practice to put these inside the namespace as well?
For example:
var shapes = {
Rectangle: function(w, h) {
this.width = w;
this.height = h;
}
};
which can be called via:
var square = new shapes.Rectangle(10,10);