Saturday, October 16, 2021

Understand the Constructor Property

 function Dog(name) {

  this.name = name;
}

// Only change code below this line
function joinDogFraternity(candidate) {
  if(candidate.constructor === Dog){
    return true;
  }else{
    return false;
  }
}
//test
let beagle = new Dog();

console.log(joinDogFraternity(beagle))
//result
//true

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...