Open In App

ES6 Tutorial

Last Updated : 01 Feb, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

ES6 or ECMAScript 2015 is the 6th version of the ECMAScript programming language. ECMAScript is the standardization of Javascript which was released in 2015 and subsequently renamed as ECMAScript 2015.
ECMAScript and Javascript are both different.

Basics

Objects

New Features in ES6

Advance

Methods

Differences

Miscellaneous

Extra

FAQs

1. How do arrow function different from regular function?

Arrow functions have shorter syntax than regular function. Also, they do not bind “this” from the surrounding. It is bsically shorthand for the regular function.

2. What is template literal in ES6?

It is the expression for embeding the HTML or other variable in a string format. It can be used in making multiple lines and string interpolation. It uses backticks(“) for string literal template.

3. What does the spread/rest operator do in ES6?

Spread operator is used when there is expectation of more than one parameter in a function. it gives the iterable form of array of multiple elements passed by the function as parameters. While the rest operator uses the same syntax but it collects elements into the array.

4. What is destucturing assignment in ES6?

It allows the extraction of values from arrays or properties from the objects of distinct variables. By using this we can assign more than one values to the more than one variables at a same time.

5. What is the purpose of let and cost in ES6?

const is used when there is no need to change in value and let is used because of it’s block scope feature that helps in avoiding the hoisting related issues. Both are used to assign a value to the variables but according to thier block and local scope they are according to the need of variable assignment.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads