1

how can I call a static function from an instantiated class variable?

Example:

class Foo {
  static Bar() {
    console.log("Bar");
  }
}

let i = new Foo();

i.Bar() // Not working

// Something like this?
i.toClass().Bar();
Rickser
  • 45
  • 4

1 Answers1

0

As Bar is static, so you call it simply with class name Foo

Foo.Bar();