daily pastebin goal
47%
SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Person{
  2.     constructor(name, age){
  3.         this.name = name;
  4.         this.age = age;
  5.     }
  6.     tellMyName() { return `I am ${this.name}`}
  7.     tellMyAge() { return `I am ${this.age}`}
  8. }
  9.  
  10. const john = new Person ("John", 40);
  11. const mary = new Person ("Mary", 35);
  12.  
  13. console.log(john.tellMyName() + " and " + john.tellMyAge());
  14. console.log(mary.tellMyName() + " and " + mary.tellMyAge());
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top