-
Book Overview & Buying
-
Table Of Contents
React and React Native - Sixth Edition
By :
As we embark on this journey to learn about type-checking and validation, let’s momentarily step away from React and React Native and turn our attention to TypeScript. You might be wondering, "What exactly is TypeScript?"
Developed and maintained by Microsoft, TypeScript is a superset of JavaScript. In other words, it’s JavaScript with additional features, the most significant being static typing. While JavaScript is dynamically typed, TypeScript introduces a type system that allows you to explicitly define the data types of variables, function parameters, and return values.
But don’t worry, TypeScript is completely compatible with JavaScript. In fact, any valid JavaScript code is also valid TypeScript code. TypeScript uses a transpiler (a type of compiler) to convert TypeScript code, which browsers can’t understand directly, into JavaScript code, which can run in any environment where JavaScript runs.
Consider the following...