Saturday, October 16, 2021

Use Prototype Properties to Reduce Duplicate Code

 function Dog(name) {

  this.name = name;
}
Dog.prototype.numLegs = 4;


// Only change code above this line
let beagle = new Dog("Snoopy");

console.log(beagle.numLegs)
//4

No comments:

Post a Comment

methods available in Dapper

  Dapper is a micro ORM library for .NET and .NET Core applications that allows you to execute SQL queries and map the results to objects. D...