I´m learning javascript OOP and I´m having issues understanding inheritance. Could you explain me why the outcomes from this two codes differ? :
function a(){}
function b(){
this.uno = "hello"}
b.prototype = new a();
function c(){
this.dos = "bye"}
c.prototype= new b();
var obj = new c();
console.log(obj.uno);
console.log(obj.dos);
console.log(obj.constructor);
//hello
//bye
//[function: a]
function a(){}
function b(){
this.uno = "hola"}
b.prototype = new a();
function c(){
this.dos = "bye"}
c.prototype = {constructor:b}
var obj = new c();
console.log(obj.uno);
console.log(obj.dos);
console.log(obj.constructor);
//undefined
//bye
//[function: b]
I truly appreciate any guide on the subject.
