title: What is the difference between types String and string?
body: <p>Does anyone know the difference between <code>String</code> and <code>string</code> in TypeScript? Am I correct in assuming that they ought to be the same?</p>
  <pre><code>var a: String = &quot;test&quot;;
  var b: string = &quot;another test&quot;;
  a = b;
  b = a; // this gives a compiler error!
  </code></pre>
  <p>Current version of the compiler says:</p>
  <pre><code>Type 'String' is not assignable to type 'string'.
    'string' is a primitive, but 'String' is a wrapper object.
       Prefer using 'string' when possible.
  </code></pre>
  <p>Is that a bug?</p>