Created
June 19, 2021 17:47
-
-
Save ashwinkumar2438/6c5d67e0bd4619ef8054992ef89aa681 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Person=function(name){ | |
this.name=name; | |
} | |
Person.prototype.run=function (){ return `${this.name} is running.`}; | |
Person.prototype.sleep=function (){return `${this.name} is sleeping.`}; | |
let woman=new Person('She'); | |
let man=new Person('He'); | |
woman.run(); // @returns "She is running." | |
man.sleep(); // @returns "He is sleeping." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment