Answers for "How can I call a method from a class without instantiating it?"

0

How can I call a method from a class without instantiating it?

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

API.getUsers();
console.log( API.version );
Posted by: Guest on March-31-2022

Code answers related to "How can I call a method from a class without instantiating it?"

Code answers related to "Javascript"

Browse Popular Code Answers by Language