TypeScript generics are a incredibly powerful feature of TypeScript. They allow you to add some nice constraints to your development workflow that go hand-in-hand with the power of types in TypeScript.
You can be sure your code works as expected by using typed arguments in your TypeScript code. You can even create interfaces to define what your arguments should look like and the TypeScript compiler will make sure your code adheres to that contract. This is one step forward in learning Type-Driven-Developement with TypeScript!
We’re going to talk about Interfaces in TypeScript today! Interfaces are used in lots of languages like Java and C#. Used correctly, they can become a great tool alongside strong type checking to validate that your code is doing what you expect it to do. TypeScript interfaces are a compiler tool to help you write…
Declared variables in TypeScript are strongly typed, meaning that if you declare a variable as one type, you can’t reassign it to another type. You have simple variable statements. You also have let and const declarations. Enjoy this quick bite-sized intro to TypeScript declarations. Photo attribution: https://www.flickr.com/photos/mspell/4528694882/