An Interest In:
Web News this Week
- April 27, 2024
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
Thoughts of Learning typescript for the past few weeks
For the past few weeks, I have been learning Typescript. So, just to understand my learning I want to answer a question about typescripts.
What is typescript?
According to their website, TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.
Through my learning what I understand is that typescript is an extension of JavaScript. It helps you validate your variables and functions in a better way with faster implementation. Also with typescript, we can handle our errors faster and can detect them very easily. It increases our productivity by adding some additional syntax and by catching errors earlier by our editor.
In the above screenshot, we can see two-variable declared with the let keyword. later it was changed into different types as "a" to number and "b" to string. Which is completely okay in JS. But in typescript, you need to declare the types so that further changes of value can remain in the same type. Like below.
Although in typescript there are some syntax and methods that can convert a variable to multiple types.
Original Link: https://dev.to/kamrulhaider/thoughts-of-learning-typescript-for-the-past-few-weeks-3966
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To