DEV Community

Sahil Thakur
Sahil Thakur

Posted on

 

Started with TS

So, after an year of delaying - finally started learning typescript. Any advice?

Top comments (4)

Collapse
 
sergchr profile image
Serhii

Get familiar with basics and then just practice a lot. Pick some project ideas and start!
Why did you decide to learn TS?

Collapse
 
sahilthakur7 profile image
Sahil Thakur

Have been recommended TS by a lot of my friends so thought of using it. Anyways, it's just a superset of JS, will only improve code than do anything else.

Collapse
 
jwp profile image
John Peters

Install Angular, use cli to create a new Angular/typescript project, and you're off!

Collapse
 
adam_cyclones profile image
Adam Crockett

Do nothing different other than add types to start with. Do not convince yourself that this is anything other than JavaScript.

typescript

11 Tips That Make You a Better Typescript Programmer

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!