Skip to content

Instantly share code, notes, and snippets.

@zwacky
Created October 21, 2016 22:34
Show Gist options
  • Save zwacky/372188f93c6a706c8b2680825f7758da to your computer and use it in GitHub Desktop.
Save zwacky/372188f93c6a706c8b2680825f7758da to your computer and use it in GitHub Desktop.
TypeScript: string (primitive type) vs String (object type)
let objectType: String = 'first string';
let primitiveType: string = 'second string';
objectType = primitiveType; // √
primitiveType = objectType; // compiler error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment