Skip to content
BENIBIX Learn

JavaScript vs TypeScript

TypeScript is JavaScript with types added. The types are checked before the code runs, then they are taken away.

Development🔤 Languages

JavaScript

The language every web browser runs. It makes web pages react to clicks and typing.

JavaScript is the language that runs inside every web browser. It makes pages react: menus open, forms check what you typed, and maps move when you drag them. It was made in 1995 at Netscape. Today Node.js also runs it on servers, so one language can cover a whole website. Its official standard is called ECMAScript.

Example
Lucy picks a second pair of shoes. JavaScript on the page updates the cart total at once.
Why it matters
If code runs in a web page, it is almost always JavaScript. Every web developer has to know some.
Full entry
Development🔤 Languages

TypeScript

JavaScript with types added. It catches lots of mistakes before the code runs.

TypeScript is JavaScript with types added. You can say a value must be a number, a string or a certain shape of object. A checker reads the code and warns you before it runs if a type is wrong. A tool then turns it into plain JavaScript, so it runs anywhere JavaScript does. It came out in 2012, and many big web apps now use it.

Example
Microsoft made TypeScript, and its VS Code editor is written in it. Jack types "twelve" where a number goes, and the line turns red.
Why it matters
Big JavaScript projects get hard to change safely. Types let the editor point out what a change will break.
Full entry

In one line

JavaScript
The language every web browser runs. It makes web pages react to clicks and typing.
TypeScript
JavaScript with types added. It catches lots of mistakes before the code runs.