To call a public static property on an instance of a class in JavaScript, you need to access the property through the constructor function of the class rather than on the instance itself.
Here is an example:
index.tsx227 chars8 lines
As you can see, accessing the static property on the class MyClass
directly returns its value, while accessing it on an instance myInstance
returns undefined
.
gistlibby LogSnag