Class definition confuse in Typescript and ES6
<p>All:</p>

<p>I am pretty new to ES6 and typescript and currently study both side by side. </p>

<p>When I come to Class definition part, there is one question:</p>

<p>Is there a major syntax between them in class declaration:</p>

<p>What I find out is:</p>

<p>In ES6, there is only method can be declared but no member :</p>

<pre><code>class Greeter {
    constructor(message) {
        this.greeting = message;
    }
    greet() {
        return "Hello, " + this.greeting;
    }
}
</code></pre>

<p>While in TypeScript, it allows to declare the member variable as well:</p>

<pre><code>class Greeter {
    // although it declare a variable "greeting" here, but I am not sure if it allows assignment initialization
    greeting: string; 
    constructor(message: string) {
        this.greeting = message;
    }
    greet() {
        return "Hello, " + this.greeting;
    }
}
</code></pre>

<p>I am not sure if this is the major syntax diff(plus access modifier, there is one related question about modifier: I read that ES6 class can not define static member, then what is the point to allow define static method?) between them?</p>

<p>If more than this, what else need to pay attention?</p>

<p>Thanks</p>