Skip to content

Instantly share code, notes, and snippets.

@mehdihettak
Created March 18, 2019 11:27
Show Gist options
  • Select an option

  • Save mehdihettak/929d956c3140b28d5ba4dcd8bb4ea643 to your computer and use it in GitHub Desktop.

Select an option

Save mehdihettak/929d956c3140b28d5ba4dcd8bb4ea643 to your computer and use it in GitHub Desktop.
class person {
constructor(name, age) {
this.age = age;
this.name = name
}
tellMyAge() {
console.log(`I am ${this.age} years old`)
}
tellMyName() {
console.log(`I am ${this.name}`);
}
}
const john = new person("John", 40)
const mary= new person("Mary", 35)
john.tellMyName()
john.tellMyAge()
mary.tellMyName()
mary.tellMyAge()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment