JavaScript Vs TypeScript : Which One Is Better For You ?

HtmlCssMonk
3 min readDec 5, 2020

By — HtmlCssMonk

Hey wanderer, Are you in a dilemma of which scripting language, TypeScript or JavaScript, to go with? Well, this is just the right place for you. This article on JavaScript vs TypeScript will give you a complete understanding of both TypeScript and JavaScript programming language, to help you make your decision.

What is ?

JavaScript

JavaScript is a scripting language which helps you create interactive web pages. It followed rules of client-side programming, so it runs in the user’s web browser without the need of any resources forms the web server. You can also use Javascript with other technologies like REST APIs, XML, and more.

The idea behind developing this script is to make it a complementary scripting language like Visual Basic was to C++ in Microsoft’s language families. However, JavaScript is not designed for large complex applications. It was developed for applications with a few hundred lines of code !

Test your JavaScript skills with Amazing Quizzes.

TypeScript

Typescript is a modern age Javascript development language. It is a statically compiled language to write clear and simple Javascript code. It can be run on Node js or any browser which supports ECMAScript 3 or newer versions.

Typescript provides optional static typing, classes, and interface. For a large JavaScript project adopting Typescript can bring you more robust software and easily deployable with a regular JavaScript application.

Features

JavaScript

  • Open source project with Microsoft’s patronage
  • Flexible, dynamic and cross-platform
  • Used for both client-side and server-side
  • Lightweight interpreted
  • Supported by all browsers
  • Weakly typed
  • JIT compilation
  • Specially designed tool for small scripts
  • Supports classes, interfaces & modules
  • Allows cross-compilation

TypeScript

  • Easy to maintain and enhances project productivity
  • Static typing and annotations are possible
  • Supports object-oriented features like interface, inheritance, and classes
  • Easy to debug and early detection of errors
  • Supports ES6 (ECMAScript) that offers easier syntax to handle objects and inheritance features
  • The good full-fledged IDE support
  • It supports JS libraries & API Documentation
  • Better code structuring and object-oriented programming techniques

History

JavaScript

Let see an important landmark in the history of Javascript:

  • It was launched in September 1995, and It took just ten days to develop this e scripting language which was initially called Mocha
  • In November 1996, Netscape submitted JavaScript to ECMA (European Computer Manufacturers Association) International
  • ECMAScript 2 was released in 1998
  • ECMAScript 3 was released in 1999
  • In 2005, Eich and Mozilla join ECMA to develop E4X Java script
  • In January 2009, the CommonJS project was launched with the aim of defining a common standard library
  • June 2011, ECMAScript 5.1 was released
  • In June 2015. ECMAScript 2016 was released
  • The current version is ECMAScript 2017 which was released in June 2017

TypeScript

Let see important landmarks from the History of Typescript:

  • The typescript was first made public in the year 2012
  • After two years of internal development at Microsoft. TypeScript 0.9, released in 2013
  • Additional support for generics TypeScript 1.0 was released at Build 2014
  • In July 2014, a new TypeScript compiler came which is five times faster then it’s previous version
  • July 2015, support for ES6 modules, namespace keyword, for, of support, decorators
  • In November 2016, an added feature like key and lookup types mapped types, and rest
  • On March 27, 2018, conditional types, the improved key with intersection types supports added in the Typescript.

How to use

JavaScript

There are two ways to use JavaScript in an HTML file.

  • Embed all the JavaScript code into the HTML code.
  • Create a separate JavaScript file that can be called from within a Script element (enclosed by Script tags).

TypeScript

TypeScript codes are written in files followed with the .ts extension. A TypeScript compiler needs to be installed on your platform which then compiles the TypeScript code to plain JavaScript file using the command “tsc .ts” . A TypeScript file can be written in any code editor and once it gets converted to plain JavaScript file, it can be included in the HTML and can be run on any browser.

— — — — — — — — — — — — — — — — — — — — — — — — — — — — —

Click here to read full article

Thanks!

--

--

HtmlCssMonk

HtmlCssMonk.com has Mind-blowing Web development Articles. We also have Amazing tutorials and Quizzes.