EDIT 2: In fact, my Object.assign does exactly the same thing as your example of composition. And
console.log(obj1.author === obj2.author);
produces 'true'.
https://jsbin.com/vafudizumo/1/edit?js,console
Either you're doing composition wrong, or I'm not doing inheritance like you are claiming.
EDIT: I fixed your example. https://jsbin.com/zamuqoropa/1/edit?js,console
EDIT 2: In fact, my Object.assign does exactly the same thing as your example of composition. And console.log(obj1.author === obj2.author); produces 'true'. https://jsbin.com/vafudizumo/1/edit?js,console Either you're doing composition wrong, or I'm not doing inheritance like you are claiming.