function Dog(name) {
this.name = name;
}
Dog.prototype = {
// Only change code below this line
numLegs : 4,
eat: function(){
console.log("Food Food Food")
},
describe: function(){
console.log("My name is "+this.name);
}
};
let beagle = new Dog("Tiger");
for(let x in beagle){
if(beagle.hasOwnProperty(x)){
console.log('ownProps',x);
}else{
console.log('prototypes:',x)
}
}
//result
/*
ownProps name
prototypes: numLegs
prototypes: eat
prototypes: describe
*/
Saturday, October 16, 2021
Change the Prototype to a New Object
Subscribe to:
Post Comments (Atom)
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...
-
AddMvcCore minimum set of services to route and invoke controller. most websites will need more configuration than this. AddAuthorization au...
-
Effect-hooks We have already used state hooks that were introduced along with React version 16.8.0 , which provide state to React compo...
-
Object Wrappers object wrappers are object-oriented code that includes other code inside for example. you can take structured code (such as ...
No comments:
Post a Comment