Javascript ES6 Features

Last updated Jan 30, 2025

ES is abbreviated as ECMAScript. Which is standard name of JavaScript. The Programming language has many names such as Typescript, Coffee Script, etc,. Because of it's specific outstanding features using the same standard. But whichever follows or implements ECMAScript is JavaScript for sure.

What is ES6 means?

It's very simple EcmaScript 2015 i.e., ES20(1+5 = 6) i.e., ES6 '6th Edition'.
The new functionalities that are added to the standard specification is indicated in yearly edition.

 

But what features does JavaScript can bring to the table? right!
The answer depends on the usage level. Yeah, JavaScript not anymore kitten in the box.
It has grown very vastly in every single industries. Companies started to depend on single code base for web resources since JavaScript can do it in ease.

 

Ease ?!

Yeah that's where ES plays a vital role. Most features are backward-compatible. But not all. Because, People are as sly as a fox nowadays yeh! ????.

Okay, that's quite intro to what we're gonna discuss. But remember ES6 is ES2015.
Now we're in 2021. Don't be smart and tell me ES20(2+1 = 3) i.e., ES3 ????.
It's "12th Edition – ECMAScript 2021".

 

But you don't need any of these mumble jumble things to understand new???? Blazing? JavaScript features. Just search for your requirement and search for any built-in functionality. If you don't have the feature built-in then just search for library a.k.a package that resolves your need ¯\_(?)_/¯.  Now you'll get a question, Well how getting a open-source package will resolve my version problems ?.

 

It does in a way. Every new features can be written by anyone around the world. But the core will validate those and they decide whether to release or put on hold. ???? Believe me that's how it works.

Javascript ES Features

 

Okay, Let's get started with ES6

why ES6 you may ask!. Well it's major version where many breaking changes introduced. These are just important among a flood of changes and features in ES6. If I Cover Every single feature in this single article. I'm pretty sure I will die like sauron.

 

This article covers up to Arrow Functions and future article will cover others. If you're a "super saiyan" and you wait for nothing. Go ahead and click the links above or stay with me to listen my crappy puns.

 

The let & const keyword

Before ECMAScript 2015. JavaScript has as wierd advantage. where you'll create a variable using 'var' keyword. Wait what's the weirdness here right!. Well the "Weird advantage" is known as Hoisting.

 

In programming term: If you "hoist something" means "you're lifting to top"

It's not problem in some scenarios. But in some scenarios it's a pain in your (?_?). If you read carefully. This problem should be a reason to leave the programming language right. That's why I told it's a weird advantage. Creators didn't removed that kinda behavior. But a programming should have it's own standards. So, they came with the new concept of "let" and "const".

 

 

"let" keyword will let you declare dynamic variable and "const" will let you declare "CONSTANTS". Also "var" is still in JavaScript and it won't get deprecated.

 

 

Arrow Function

JavaScript loves to work like as other programming languages around world. But the difference is it itself. Typical function will be like:

 

function functionName(parameter1parameter2) {
    something = parameter1 + parameter2
    return something
}

 

 

Of course JavaScript has this way of implantation. But in a nutshell "JavaScript works kinda tricky ????". Everything is inherited from Single global object. Seems strange right. If you're creating function, Class, variable, string, whatever it's an reference of the "Prototype Object". About prototype, I won't explain it here. It's an separate article for future.

 

But I want you to take away this. JavaScript is itself a Language which interprets instead of compilation. The compilation takes place in engine. So, It designed in way to achieve more efficiency. That's how arrow function concept works here.

 

// Arrow Function
const variableName = (parameter1, parameter2) => {
    something = parameter1 + parameter2;
    return something;
};

 

 

Now did you notice the magic happened ????. That's JavaScript. For people coming from C, C++ may be look this like Christopher Nolan movie. But it isn't that hard to understand. Since, JavaScript has this flexibly you can pass function as value to a variable and "=>" this is know the "Fat Arrow". The function body follows is called "Arrow Function". Sounds fun right. Well it's not the end of it. There's much more. You pass functions in many fields that you don't know. Some examples:

 

// Function as property to object
const obj = {
    getSomeThing: function () {
        return someThing;
    },
};

 

// Arrow Function as property to object
const obj = {
    getSomeThing: () => {
        return someThing;
    },
};

 

// Also you don't need ":".
// This is known as "Object Literals with ES6"

 

const obj = {
    getSomeThing() {
        return someThing;
    },
};

 

 

See how concise it is. It's not traditional. But it's cool right.

 

To be Continued...

Some of useful resources to learn JavaScript: