1

I did something like this.

var person = function (){
  this.print = function ()
  {
    console.log('person');
  }
}

console.log(person.prototype);

This logs Object{}, but if I do:

person.prototype.print = function () {  
  console.log('person');
}

console.log(person.prototype);

Now it prints the entire object and its proto

BenM
  • 52,573
  • 26
  • 113
  • 168
Yash Kolte
  • 11
  • 1

0 Answers0