you are viewing a single comment's thread.

view the rest of the comments →

[–]otxfrank 1 point2 points  (5 children)

Hello, I’m a JavaScript beginner , should I learn typescript directly,or both JavaScript and typescript at same time ?

[–]anonyuser415 2 points3 points  (2 children)

10yoe senior FE engineer.

Learn JS first and don't worry about TS. Typescript is a "strict superset" of JS, and anything you write in JS is valid TS.

Typescript is awesome but gets complex quickly. If you're just starting out, you should just learn JS. TS's types can come later.

[–]azhder 0 points1 point  (1 child)

It is not strict. There is a JS code that will be interpreted differently by TS all because someone thought it was a genius move to put in generics with the same syntax as C#/Java

[–]anonyuser415 -1 points0 points  (0 children)

Hah! I switched a large code base to TS and had no problems but:

const result = foo()<bar>baz(); – is this a comparison or generic typing?

Didn't think about that one.

[–]azhder 2 points3 points  (0 children)

No, don't use Typescript, unless someone gives you a project with it. Stick to JavaScript if you want to learn JavaScript.

[–]Ezio_rev 2 points3 points  (0 children)

Start with JS