Skip to content

Instantly share code, notes, and snippets.

@ashwinkumar2438
Created June 20, 2021 06:38
Show Gist options
  • Save ashwinkumar2438/679de88a5fe9f245d22e81c6928b0ba9 to your computer and use it in GitHub Desktop.
Save ashwinkumar2438/679de88a5fe9f245d22e81c6928b0ba9 to your computer and use it in GitHub Desktop.
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