title: Typescript let keyword and not defined type variable difference
body: <p>I am new to typescript, I know the difference between let and var. But I am not able to understand for what variables we use the 'let' keyword and for what we dont.</p>
  <p>In the code here</p>
  <pre><code>class ClassName{
     let num: number = 10; // Error &quot;A Constructor, method, accessor or property expected&quot;
     num = 10; //Works fine
  }
  
  varName: ClassName = new ClassName() // Error &quot;Cannot assign to ClassName because it is not a variable&quot;
  let varName: ClassName = new ClassName() // Works fine
  </code></pre>
  <p>So we should use let outside classes and should'nt use inside the classes? why if so?</p>
  <p>or there is another important difference between them?</p>