Typescript
Typescript
TypeScript..
VS ES6
ES5
ES5 VS ES6
ES5 ES6
• ES5 supports primitive data types that are string, • In ES6, there are some additions to JavaScript
number, boolean, null, and undefined. data types. It introduced a new primitive data
type 'symbol' for supporting unique values.
• In ES5, we could only define the variables by • In ES6, there are two new ways to define
using the var keyword. variables that are let and const.
• As ES5 is prior to ES6, there is a non-presence of • Because of new features and the shorthand
some features, so it has a lower performance than storage implementation ES6 has a higher
ES6. performance than ES5.
• ES5 is time-consuming than ES6. • Due to destructuring and speed operators,
object manipulation can be processed more
smoothly in ES6.
• In ES5, both function and return keywords are • An arrow function is a new feature introduced in
used to define a function. ES6 by which we don't require
the function keyword to define the function.
• In ES5, there is a use of for loop to iterate over • ES6 introduced the concept of for...of loop to
elements. perform an iteration over the values of the
iterable objects.
Difference Between TypeScript and
JavaScript.
VS JavaS
S cri pt cript
Ty p e
Parameter Typescript JavaScript
1) What is ✔ Powerful type system, including generics ✔ Lightweight, interpreted, object-
& JS features oriented language with first-class
functions
2) Data Binding ✔ TypeScript uses concepts like types and ✔ No such concept is available with
interfaces to describe data being used. JavaScript.
6) Community ✔ Typescript does not have a large ✔ The JavaScript has a huge community
community of developers. of developers
Typescript code example…
Why TypeScript ?
✔ TypeScript is a superset of JavaScript which primarily provides
optional static typing, classes and interfaces.
✔ One of the big benefits is to enable IDEs to provide a richer
environment for spotting common errors as you type the code.
✔ It is open source, but you only get the clever Intellisense as you type if
you use a supported IDE.
✔ TypeScript supports JS libraries & API Documentation
✔ Better code structuring and object-oriented programming techniques
✔ Allows better development time tool support
✔ It can extend the language beyond the standard decorators, async/await
Features of JavaScript and
TypeScript…
JavaScript TypeScript
✔ It’s used for client side and server side ✔ Offered great productivity for
developers
✔ It’s easy to learn and to start with ✔ Code navigation and bug prevention