I've finally found a satisfactory way to create classes on JavaScript. Are there any cons to it?
What about regular inheritance? Is extend supposed to be the superclass?

foo = { foo: "bar" };

a = my_class(foo);
b = my_class(foo);

a.foo = "baz";
console.log(b.foo);

--&gt; "baz";


I would expect a and b to have their own state, yet they share a single foo property.