JavaScript v TypeScript
JavaCode7
Posted on June 8, 2021
JavaScript. By far one of the most famous programming languages for its applications in scripting, gamedev and most notably web apps 🌐. Then its brother, TypeScript. Famous for being statically typed. It adds more features to JavaScript. Which one is better? 🤔 I guess today we find out.
Disclaimer
What follows is going to be my opinion inferred from fact. This may or may not be true. Please read this article accordingly.
JavaScript
JavaScript has many features, scripting, web apps and is even supported in some game engines. To sum it up nicely:
- ✔ Dynamically typed (beginners don't mix up typing)
- ❌ No optional parameters
- ❌ No interfaces
- ✔ Some game engine support
- ✔ Compiled not transpiled
- ❌ No TS file imports
TypeScript
TypeScript has similar syntax to JavaScript but with a few features added.
- ❌ Statically typed
- ✔ Optional parameters
- ✔ Interfaces
- ❌ Transpiled
- ✔ Both TS and JS imports
- ✔ Most JS frameworks support TS
Based on all of this, and my experience using both languages. I would say that TypeScript is better than JavaScript. You may disagree however. If you do, please comment 💬! I would love to hear your opinions!
Posted on June 8, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.