TypeScript introduces strong typing to JavaScript through a simple syntax, referred to by Anders Hejlsberg as "syntactic sugar".
This chapter is an introduction to the syntax used in the TypeScript language to apply strong typing to JavaScript. It is intended for readers that have not used TypeScript before, and covers the transition from standard JavaScript to TypeScript. If you already have experience with TypeScript, and have a good understanding of the topics listed below, then by all means have a quick read through, or skip to the next chapter.
We will cover the following topics in this chapter:
Basic types and type syntax: strings, numbers, and booleans
Inferred typing and duck-typing
Arrays and enums
The any type and explicit casting
Functions and anonymous functions
Optional and default function parameters
Argument arrays
Function callbacks and function signatures
Function scoping rules and overloads