DEV Community

Cover image for You Can't Learn TypeScript without JavaScript!!!
Tina Huynh
Tina Huynh

Posted on

You Can't Learn TypeScript without JavaScript!!!

There's a frequent questions that gets thrown around, "Should I learn JavaScript or Typescript??" Well, to be frank, YOU CAN'T LEARN TYPESCRIPT WITHOUT LEARNING JAVASCRIPT!!

You don't NEED to learn TypeScript though. But that doesn't mean you should not learn TypeScript. The great thing about TYpeScript is that it is a superset of JavaScript, which means all JavaScript is valid TypeScript. And once you have no issues writing JavaScript, learning TypeScript will be easy.

TypeScript shares syntax and runtime behavior with JavaScript. The great thing about TypeScript is that it always points out the compilation errors at the time of development (pre-compliation). It supports static/strong type, which means that type correctness can be checked at compile time!

TypeScript is NOT a replacement for JavaScript. They both have their advantages and disadvantages. While JavaScript is better suited for small-scale applications, TypeScript is better for larger applications. TypeScript features prototyping while JavaScript does not. TypeScript supports interfaces, which JavaScript doesn't. And TypeScript supports static typing, which JavaScript doesn't have.

Whether you end up learning one or both, it's all up to you. But, of course, start with JavaScript and work your way up.

Happy coding!

Top comments (2)

Collapse
 
khanh_mai_9bb15a444149dfe profile image
Khanh Mai

Haha

Collapse
 
chadsteele profile image
Chad Steele

I think learning, truly learning, javascript makes typescript unbearable. Typescript is just another M$ hijack of a better idea... remember when they ruined rest and http with f'n winforms? Remember Soap? Com? I do. Duck typing is awesome if wielded well, typescript is like putting training wheels on a fish. Wrong paradigm. Wrong animal. Strict typing is fine, but not on top of a language whose greatest asset is dynamic typing. jmho