JavaScript vs TypeScript
TypeScript is JavaScript with types added. The types are checked before the code runs, then they are taken away.
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.
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.
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.