Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js basic user class

class User {
  constructor(name) { this.name = name; }
  sayHi() { alert(this.name); }
}

// proof: User is a function
alert(typeof User); // function
Source by javascript.info #
 
PREVIOUS NEXT
Tagged: #js #basic #user #class
ADD COMMENT
Topic
Name
2+4 =