9 ES6 Features Every JavaScript Developer Should Know

9 ES6 Features Every JavaScript Developer Should Know

ES6 brings more amazing features to the JavaScript language. So without any further ado, let’s dive right in to see what are they and how they can help you write code more efficiently.

ES6 brings more amazing features to the JavaScript language.

So without any further ado, let’s dive right in to see what are they and how they can help you write code more efficiently.

1. Rest Parameters

Take a look at a built-in function in JavaScript:

Math.max(arg1, arg2, …, argN)

You can call that function with any number of arguments. Like:

let max1 = Math.max(3, 5, 5, 1); // 5

let max2 = Math.max(23, 1, 56, 23, 13, 67); // 67

Using ES6 rest parameters feature, you can define functions just like Math.max.

Here’s how:

function averageOf(…numbers) {
  let sum = 0;

  for (let number of numbers) {
    sum += number;
  }
  return sum / numbers.length;
}
let average = averageOf(5, 6, 2, 1); // 3.5

And that’s how the three dots (…) help you build special functions.

coding javascript web-development es6 javascript-development

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Hire Dedicated JavaScript Developers -Hire JavaScript Developers

Hire dedicated JavaScript Developers who are proficient in AngularJS, ReactJS, NodeJS, & VueJS frameworks. Get flexible hiring models as per your business requirements.

Exposing Most Common Web Development Myths | ByteCipher

Are you looking for the best Web and Mobile App Development Company in India? We at ByteCipher are offering creative & custom web and mobile app development services worldwide

Why Web Development is Important for your Business

With the rapid development in technology, the old ways to do business have changed completely. A lot more advanced and developed ways are ...

Important Reasons to Hire a Professional Web Development Company

    You name the business and I will tell you how web development can help you promote your business. If it is a startup or you seeking some...

Web App Development Company | Web Application Development Service

Web development company in India & USA offers different types of web application development services with the best result oriented, clients all specifications, different technologies, etc with a cost-effective rate. Get a free quote.