Pitayan | 8 Javascript quiz that may confuse you

PHOTO EMBED

Sat May 07 2022 22:59:16 GMT+0000 (Coordinated Universal Time)

Saved by @mohamed #javascript

function Animal(){ 
  this.type = "animal"
}
   
function Dog(){ 
  this.name = "dog"
}
 
Dog.prototype = new Animal()
 
var PavlovPet = new Dog(); 
 
console.log(PavlovPet.__proto__ === Dog.prototype)
console.log(Dog.prototype.__proto__ === Animal.prototype)
content_copyCOPY

https://pitayan.com/posts/8-javascript-quiz-that-may-confuse-you?utm_medium