SHARE
TWEET

Untitled

a guest Oct 18th, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // 1.challenge.POO)
  2.  
  3. class person{
  4.    constructor(name, age){
  5.        this.name = name;
  6.        this.age= age;
  7.    }
  8.     tellMyName(){
  9.         return this.name,
  10.         console.log(`I am ${this.name}`);
  11.     }
  12.  
  13.     tellMyAge(){
  14.         return this.age,
  15.         console.log(`I am ${this.age} years old`);
  16.     }
  17.      
  18.  
  19.    
  20. }
  21.  
  22. const John = new person("John",40);
  23. const Mary = new person("Mary",35);
  24.  
  25. John.tellMyName(), John.tellMyAge()
  26. Mary.tellMyName(), 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