Hi,
I like to learn the difference between Class Property and Prototype in Javascript what I mean is shown in the code :
function Rectangle(x, y) {
this.width = x;
this.height = y;
}
Rectangle.UNIT = new Rectangle(1, 1);
Rectangle.prototype.UNIT = new Rectangle(1, 1);
The thing I know is prototype is working like inherit object which means UNIT will be shown all the instances from now on but Rectangle.UNIT = new Rectangle(1, 1);
code doesn't do the same thing ?