-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Intro
Defining Pseudo Class
function Building(floors) {
this.what = "building";
this.floors = floors;
}
var myHouse = new Building(3);
console.log(myHouse);
function Food(type) {
this.type = type;
}
Food.prototype.countTypes = function() {
console.log(`There are ${this.type} in total`);
};
var myLunch = new Food(3);
console.log(myLunch.countTypes());
Class Methods for all instances
Building.prototype.countFloors = function() {
console.log(`I have ${this.floors}`);
};
Metadata
Metadata
Assignees
Labels
No labels