Open In App

Difference between ES5 and ES6

Improve
Improve
Like Article
Like
Save
Share
Report

ECMAScript 5 (ES5P)

ES5 is also known as ECMAScript 2009 as it was released in 2009. It is a function contractors focus on how the objects are instantiated. For ES5 you have to write a function keyword and return, it to be used to define the function, like in normal general JavaScript language. 

ECMAScript 6 (ES6)

ES6 is also known as ECMAScript 2015 as it was released in 2015. Its class allows the developers to instantiate an object using the new operator, using an arrow function, in case it doesn’t need to use the function keyword to define the function, also return keyword can be avoided to fetch the computer value. 

Difference between ES5 and ES6

ES5 ES6
ECMA script is a trademarked scripting language specification defined by Ecma International. The fifth edition of the  same is known as ES5 ECMA script is a trademarked scripting language specification defined by Ecma International. The sixth edition of the same is known as ES6 
It was introduced in 2009. It was introduced in 2015.
It supports primitive data types that are string, number, boolean, null, and undefined.  In ES6, there are some additions to JavaScript data types. It introduced a new primitive data type ‘symbol’ for supporting unique values.
There is only one way to define the variables by using the var keyword. There are two new ways to define variables that are let and const.
It has a lower performance as compared to ES6. It has a higher performance than ES5.
Object manipulation is time-consuming in ES5. Object manipulation is less time-consuming in ES6.
In ES5, both function and return keywords are used to define a function. An arrow function is a new feature introduced in ES6 by which we don’t require the function keyword to define the function.
It provides a larger range of community support than that of ES6 It provides a smaller range of community support than ES5.

Last Updated : 15 Dec, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads