Template literals in Typescript
It might be common knowledge, but I just discovered that Typescript was supporting JavaScript template literals.
Also called string interpolation sometimes, it let you do something like:
name = "John"
console.log(`Hello ${name}`)
And it will print "Hello John".
The nice thing about it is that Typescript will generate es5 compatible code (if target is set to es5 in your tsconfig.json
).