TypeScript
Explore TypeScript as a superset of JavaScript and discover its features including static typing, class-based programming, modules, and access control. Understand how these features enhance Ionic app development, improve code organization, and enforce logic correctness with type annotations.
What is TypeScript?
TypeScript is a superset of the JavaScript language. This means it contains all of the features of JavaScript but also offers additional features not found within the language, such as:
- Static typing
- Class-based, object-oriented programming (prior to ES6)
Features of TypeScript
Some of the features that TypeScript introduces are as follows:
- Modules
- Data types
- Classes
- Access modifiers
- Multiline strings
- String interpolation
Modules
A module is simply a container for organizing and grouping our code that is then able to be exported and imported for use into another script, like so:
// ...