Re:The world's smallest and fastest classical JavaScript inh...
by jtblin on Saturday February 15, 2014 @07:25PM
(#7246121)
This is nice but not quite right, it only works when overwriting the constructor. Every object in Javascript as a constructor property defined
Therefore the test on `properties.constructor` doesn't work to extend objects without overwriting the constructor e.g.
To solve this you need to test if the constructor is not the default one i.e.
Now you can extend objects without providing a new constructor:
Nice little utility other than that.
[ Parent
| on HN ]
There are no comments on this comment yet.