
Learning Angular
By :

Working with TypeScript or any other coding language means working with data, and such data can represent different sorts of content that are called types. Types are used to represent the fact that data can be text, an integer value, or an array of these value types, among others.
Types disappear during transpilation and are not included in the final JavaScript code.
You may have already met types in JavaScript since we have always worked implicitly with them. In JavaScript, any given variable could assume (or return, in the case of functions) any value. Sometimes, this leads to errors and exceptions in our code because of type collisions between what our code returned and what we expected to return type-wise. However, statically typing our variables gives our IDE and us a good picture of what kind of data we should find in each code instance. It becomes an invaluable way to help debug our applications at compile time before the code is executed.
One of the most widely...