You’ve probably came across the term ECMAScript 6 or ECMAScript 2015 or ES6 for short. As the name suggests, ES6 is the sixth version of the ECMA script programming language and was released in 2015. To make a long story short, it refers a new set of syntax used in JavaScript and all the new functions made available. So what makes ES6 different from the other previous versions? Let’s go over some of the new features!

Declaring Variables

In ES6, there are now two new ways to declare variables! Before ES6, you were limited to using var. Now with ES6, you can use let or const. Let’s go over the difference between each variable declaration.

let is used to declare a variable in which you plan or know the value which change over time. For example, a counter or a person’s bank account balance, a for loop. For example,

for (let i = 0; i < arr.length; i++) {
i = i + 1

const is short for constant, which you can imagine is used to assign a constant value to a variable. This meaning that the value will not change or be reassigned.

const example = “constantValue”

const and let are preferred over var due to var being function scoped rather than block scoped.

Arrow Functions

Arrow functions allow for a short hand syntax version of a normal function. Look below for the examples.

function example (x, y) {
return (x*y)
example = (x, y) => { return x * y }


ES6 introduced classes. Check my to where I talk more about classes in JavaScript.

class Phone {
constructor() {
this.phonename = brand;
newPhone = new Phone(“iPhone”)


Please note that these are just some of the new features in ES6. Check out the link below for more information on the new features!

Flatiron School Alumni & Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store