

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between TypeScript and JavaScript
As we know that both Typescript and JavaScript are the programming language usually used at client end for processing the server request and rendering data on UI. However, both are scripting language but Typescript supports some additional features than Javascript due to which we can state it as the superset of Javascript.
The following are the important differences between TypeScript and JavaScript.
Sr. No. | Key | TypeScript | JavaScript |
---|---|---|---|
1 | Type | In contrast of type we can say that Typescript is a heavy weight and strongly typed object oriented compile language which is developed by Microsoft. | Javascript on other hand is a light weight interpreted language and is introduced by Netscape. |
2 | Internal implementation | Internal implementation of Typescriipt does not allow it to be used at server side.It can only be used at client side. | On other hand Javascript can be used both at client side and server side. |
3 | Data binding | For binding the data at code level Typescript uses concepts like types and interfaces to describe data being used. | No such concepts has been introduced in Javascript. |
4 | Compilation | Code written in Typescript first need to get compiled and then converted to Javascript this process of conversion is known as Trans-piled. | On other hand no compilation is needed in case of Javascript. |
5 | Modular programming | Typescript gives support for modules hence allows the modular programming. | Javascript does not support modules and hence do not allow the modular programming. |
6 | Optional parameter in function | Any number of optional parameters are allowed in function code written in typescript. | On other hand JavaScript does not support optional parameter function. |
Example of Typescript vs JavaScript
JavaTester.js
<script type="text/javascript"> document.write("Hello World"); </script>
Output
Hello World
Example
JavaTester.ts
var hello: string = "Hello"; var world: string = "World"; console.log(hello + " from " + world);
Output
Hello from World
- Related Questions & Answers
- What is the relationship between JavaScript, CoffeeScript, TypeScript, ES5, and ES6?
- JavaScript/ Typescript object null check?
- Difference between Java and JavaScript.
- Difference between JavaScript and Php
- Difference Between PHP and JavaScript
- Difference between JavaScript deepCopy and shallowCopy
- Difference between == and === operator in JavaScript
- Difference between var and let in JavaScript
- Difference between console.dir and console.log in javascript?
- Difference between != and !== operator in JavaScript Program
- Difference Between Static and Const in JavaScript
- What is the difference between jQuery and JavaScript?
- What is the difference between JavaScript and C++?
- What is the difference between Java and JavaScript?
- What is the difference between JavaScript and ECMAScript?
Advertisements