Top 10 Javascript ES6 things A Js Developer Must Know

Mohammad Anisul Islam
1 min readMay 7, 2021

--

1. Default Parameters

In ES6, we can put the default values right in the signature of the functions.

var area = function(height = 100, width = 80) {  
...
...
}

2. Template Literals

In ES6, we can use a new syntax ${parameter} inside of the back-ticked string. You have to write the whole thing in `` sign.

and dynamic parameter should deploy in ${param}.

var myName= `My name is ${firstName} ${lastName}.`

3. Destructuring

The destructuring assignment syntax is a JavaScript expression that makes it possible to destructure values from specific arrays, or properties from objects, into different variables.

var myDetails= {name: 'Anis', address: 'BD'};
var {name, address} = myDetails;
console.log(name); // Anis
console.log(address); // BD

4. Modules

In ES6, there are modules with import and export operands.

Let this code is placed in the “module” file. ES6 permitted that programmer can export any part from any file by “export” keyword.

export const id = 1; 
export function myName(name) {
//code
};

It is possible to import idvariable and myName function using import statement.

import {id, myName} from 'module';
console.log(id); // 1

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Mohammad Anisul Islam
Mohammad Anisul Islam

Written by Mohammad Anisul Islam

Software Engineer || Full Stack Developer || Technical Writer || Speaker

No responses yet

Write a response