Simple prototype method that should work, but doesn't..
CodeDee (0)

Would love the knowledge if anyone can share why.

Edit: the code I wrote is in the script.js file

You are viewing a single comment. View All
CodeDee (0)

It seems like once I took out the capital letters it worked..?

function andygriffith(age, weight, height) {                                                          
  this.age = age;                                                      
  this.weight = weight;
  this.height = height;                                             
}                                                               

andygriffith.prototype.info = function(){                              
  return 'Andy Griffith is dead, but he was tall! Coming in at a whopping ' + this.height + '! He weighed ' + this.weight + ' at his death and was ' + this.age + '.';   
}                                          

let aboutandy = new andygriffith ('86', '186 lbs', '6 feet');                                                   
console.log(aboutandy.info());