function dog(){
this.barking = "woof";
this.bark = function(){console.log(this.barking)}
}
var tony = new dog();
var stark = {};
dog.call(stark);
tony.bark();// "woof"
stark.bark();// "woof"
console.log(tony.prototype == stark.prototype);// true
console.log(tony.__proto__ == stark.__proto__);// false
console.log(tony instanceof dog)//true
console.log(stark instanceof dog)//false
console.log(tony.constructor == stark.constructor);// false
console.log(tony.constructor.toString() == tony.constructor.toString());// true
What is the difference causing those results ?
Why do Tony and Stark have the same prototype but not the same proto and constructor ? (I guess instanceof results are different because of _ proto __ )
Detailed answers are very welcome