Template strings

TypeScript now supports ES6 template strings. These are an easy way to embed arbitrary expressions in strings:

  1. var name = "TypeScript";
  2. var greeting = `Hello, ${name}! Your name has ${name.length} characters`;

When compiling to pre-ES6 targets, the string is decomposed:

  1. var name = "TypeScript!";
  2. var greeting = "Hello, " + name + "! Your name has " + name.length + " characters";