Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How do I access a class without an instance? +javascript

class API {
   static getUsers() {
     console.log("Fetching users...")
   }
  static version = "1.1";
}

API.getUsers();
console.log( API.version );
 
PREVIOUS NEXT
Tagged: #How #I #access #class
ADD COMMENT
Topic
Name
8+2 =