Typescript receives universal praise on my twitter feed so I though I would spend some time checking it out. Developed and maintained by Microsoft I’m very curious to find out why people prefer it so much over JS when as a newbie it looks just like JS. TLDR it provides a lot of ‘traditional’ features.
This helpful FCC article (link) tries to answer these questions:
- What is TypeScript?
- How can I take care of build & packaging?
- How can I take care of linting?
- How can I “sell” TypeScript to my organization and developers?
A summary of the fundamentals I’ve learnt so far would be:
- TypeScript uses static typing, meaning that you can give a type to a variable during declaration.
tsconfigis a JSON file that helps to configure TypeScript. Having a config file is better since it helps to control the behavior of the compiler.
- TypeScript has several types such as number, string, boolean, enum, void, null, undefined, any, never, array, and tuple.
Other good resources that have helped my understanding of it are: