top of page
  • Writer's pictureGopal Panday

What Is The Main Things ES6/7 Added In JavaScript?

Updated: Feb 15, 2022



Javascript is a client-side and server-side scripting language which makes a web page interactive. Where Html , css creates the structure of a web page, Javascript sets up the functionality to that page.


It is case sensitive and dynamic type language.


It is a high-level language that coordinate to the ECMAscript standards .

It is mainly used for web-based application and web browser.

With the help of javascript many things can be created in javascript.

  • Information can be shown or hidden at the click of a button.

  • When the screen size is small so the hamburger menu shows in the header part then it is toggled with the help of javascript.

  • Any kind of form validation in a web page is done with javascript.

So, if you wanna know main things ES6/7 added in javascript then get started for knowing about it. Apart from this if you wanna learn javascript course then you can join web designing institute Rohini.


What is the main things ES6/7 added in javascript?

Javascript ES6 is also known as ECMAscript 2015 and javascript ES7 is also known as ECMAscript 2016.


ECMAscript is a standard that developers use in their js code.

1.Let & Const keywords:- let keyword defines variable. The same variable can not be declared again in let.


For example--- let x = "John Doe"; let x = 0; // SyntaxError: 'x' has already been declared


Variable declared in const keyword are neither redeclre nor reasigned but if there is a constant array or constant object, then their elements and properties can be changed.

For example--- const stud = [“karan”, “Sia”, “Rohan”, “Sameer”];

Stud[0] = “Mahi”;// change an element:

Stud.push(“Vijay”); // add an element;


2. Arrow Function:- Arrow function are anonymous functions. It is introduced in javascript ES6 version. It does not return any value and is declared without any function keyword.arrow function is called Lambda Function in other languages.

Types of arrow function

  • Parameters

  • Fat

  • arrow notaions

  • Statements

Example-- var myfun = function(){

Alert(“this is anonymous function”)

}


3.Spread Operator:-In this ,spread the value of any array and convert it into multiple arguments. when we call a function and pass the name of a variable with three dots attached to it, then it is called spread operator.It is always used at the time of calling.

For example----- function myfun(x,y,z){

Console.log(x,y,z)}

Let args = [0,1,2];

Myfun(…args);

Output// 0 1 2


4.Rest Parameter:- Rest parameter is introduced in javascript ES6 version.With its help, the problem of function with multiple arguments has been fixed. It is prefixed with three dots.

The syntax of rest parameter is vary similar to that of the spread operator. The rest parameter is used at the time of function declaration.

For example---- function show(…args){

Let sum = 0;

For(let i of args);{

Sum += i;

}

Console.log(sum);

}

Show(2,4,5);

Output// 11


5.Destructuring:- In destructuring, the complex structure is broken and divided into small parts. When destructuring an array, then their index valu is used at the assignment.

For example---- let value = [‘shiva’, ‘23’, ‘delhi’];

let[ name, age, city] = value;

console.log (name, age, city);


6.Exponentiation Operator:- Exponential operator is a mathematical operator which is introduced in ES7.It is similar to math.pow method. It is represented by (**)

For example--- let base = 2;

Let exponent = 3;

Console.log(‘using Math. pow()’,Math. pow (base, exponent));

Console.log(‘using exponentiation opertor’,base**exponent);


I hope this blog will be helpful for you. So, If you are looking the best JavaScript institute in Delhi for learning JavaScript course then get set go for web development institute in Delhi.

15 views

Recent Posts

See All
bottom of page