Created
June 20, 2021 06:38
-
-
Save ashwinkumar2438/679de88a5fe9f245d22e81c6928b0ba9 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
class Person{ | |
constructor(name){ | |
this.name=name; | |
}; | |
run(){ return `${this.name} is running.`}; | |
sleep(){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