Check if an object (or just a class) has a property
<p>Lets say I have a class:</p>

<pre><code>module MyModule {
    export class MyClass {
       x:number;
       y:number;
    }
}
</code></pre>

<p>Then I have a string, "x". How can I check if MyClass has property "x"?</p>

<p>If I create an instance of MyClass and then do:</p>

<pre><code>myClassInstance.hasOwnProperty("x");
</code></pre>

<p>it returns false unless x has a default value set. But I don't want to set default values for each property. It would be best if I even could do this without creating instance of MyClass.</p>