Top 10 feature of ES6 every Developer should know

I am listing top ES-6 features you must know and use these features may lead you to increase your productivity while developing a large application, these features are quite easy and daily usable.

1)  Default Parameters

var box= function(height = 50, width= 100) {
//function desc..
}

2) Template Literals

var name = `Your name is ${first} ${last}.`

var url = `http://localhost:8000/api/messages/${id}`

3) Multi-line Strings

var fourAgreements = `Your multiline

end here.`

4) Destructuring Assignment

var {json: jsonMiddleware} = require(‘body-parser’)

var {username, password} = req.body

5) Enhanced Object Literals

var serviceBase = {port: 3000, url: ‘azat.co’},

getAccounts = function(){return [1,2,3]}

var accountService = { __proto__: serviceBase, getAccounts)

6) Arrow Functions

var ids = [‘5632953c4e345e145fdf2df8′,‘563295464e345e145fdf2df9′]

var messages = ids.map(value => `ID is ${value}`)

7) Promises 

var wait = new Promise(function(resolve, reject) {

setTimeout(resolve, 1000)

}).then(function() {

console.log(‘Hey!’)

})

8) Let and Const

{

let scopeValue=100

}

{

const cValue=100

}

9) Classes

class baseModel {

constructor(options = {}, data = []) {

this.data = data

this.options = options

}

getName() {

console.log(‘function called’)

}

}

10) Modules

import {port, getAccounts} from ‘module’

console.log(port)