4 ms·
People do a morally equivalent thing in Javascript, on occasion. You can use Object.assign() to build an object's functionality from multiple unrelated objects.
by bjterry 9y ago
People do a morally equivalent thing in Javascript, on occasion. You can use Object.assign() to build an object's functionality from multiple unrelated objects. For example, see the section on concatenative inheritance here: https://medium.com/javascript-scene/master-the-javascript-interview-what-s-the-difference-between-class-prototypal-inheritance-e4cd0a7562e9 https://medium.com/javascript-scene/master-the-javascript-in...