Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 1.56 KB

File metadata and controls

26 lines (17 loc) · 1.56 KB

F.prototype easy #javascript

by Pawan Kumar @jsartisan

Take the Challenge

What would be the output of following code:

function Rabbit() {}
Rabbit.prototype = {
  eats: true
};

let rabbit1 = new Rabbit();

console.log(rabbit1.eats); // ?

Rabbit.prototype = {
  eats: false
};

cont rabbit2 = new Rabbit();

console( rabbit1.eats ); // ?
console( rabbit2.eats ); // ?

Back Share your Solutions Check out Solutions