TypeScript types are usually denoted in declarations with the type following the variable name separated by a colon. For example:
// TypeScript let num:Number = 1;
This creates variable
num of the type
Number with the initial value of 1. If you attempt to assign something other than a Number value to
num, you will get an error from the TypeScript compiler due to a type mismatch.
// TypeScript let num:Number = 1; num = 'one'; // Type '"one"' is not assignable to type 'Number'
And don’t worry if this looks tedious. Type inference in TypeScript means you often don’t even have to specify the types yourself. They can be implied automatically.
// still TypeScript let num = 1; // <- implied Number type because 1 is a Number num = 'one'; // Type '"one"' is not assignable to type 'Number'
TypeScript has been around since 2012 and has steadily been climbing in popularity since then. Even popular frameworks like Angular fully embrace it. If you’re not interested in using it in your own projects, its at least good to know what it is and what it looks like (though we have only just barely scratched the surface here). Chances are you’ll run into it at some point in the future if you haven’t already.