NameL3ss

object js

Nov 29th, 2022
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. function Animal (name, age) {
  2. this.name = name;
  3. this.age = age;
  4. this.speak = function(){
  5. console.log(`hello ${this.name}`)
  6. }
  7. }
  8. cholo = new Animal("cholito", 5)
  9. cholo.speak()
  10.  
  11.  
Advertisement
Add Comment
Please, Sign In to add comment