Imagine having a class like this:
module MyModule {
export class MyClass {
x:number;
y:number;
}
}
Now, let's say we have a string called "x". How can we determine if MyClass has the property "x"?
If an instance of MyClass is created and we use the following code:
myClassInstance.hasOwnProperty("x");
It will return false unless "x" has a default value assigned. However, we don't want to set default values for each property. It would be ideal if we could accomplish this without actually creating an instance of MyClass.