ES5 VS. ES6 (The difference)

Fekade Senbeta
2 min readApr 27, 2020

--

I would love to talk to people who coded JavaScript over 10 years ago to find out what they actually thought of ES5. It was in 2009 when ES6 was invented and made life much easier for them. They are very similar but also different at the same time. So what is ES6 or ES5 anyways? They are trade marked JavaScript languages and the 6th and 5th edition.

ES6 and ES5 are quite similar but the main differences in them would be some of their functionality. ES6 is much less time consuming that ES5 ever was. Also, ES5 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.

In ES5, we could only define the variables by using the var keyword.

var num = 5

In ES6, there are two new ways to define variables that are let and const.

const num = 5

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.

I hop this has helped someone! Thank you for reading!

--

--