Javascript ES6 Features

Top 10 ES6 Features

What is ES6?

Es6 or ECMAScript 2015 is the sixth major release of ECMAScript language which comes with a lot of new features and syntax for writing web applications in Javascript.

# Block Bindings:-

* Var Declarations and Hoisting.
* Block-Level Declarations.
* Block Binding in Loops.
* Global Block Bindings.
* Emerging Best Practices for Block Bindings.

# Function

* Default Parameter Values.
* Working with Unnamed Parameters.
* The Spread Operator.
* Block-Level Functions.
* Arrow Functions.

* Var Declarations and Hoisting.

If you want to know about variable declarations, you need to know about scope first.

What’s the scope?

Scope is the means of making variable declarations.

Hoisting:-

Other programming languages would show it as an error but javascript is who it shows undefined because javascript here saves the value of y as empty.

* Block-Level Declarations.

If any variable is declared in Curly Braces, it is called Block-Level Declarations.

* Block Binding in Loops:-

Most of the JavaScript loops work inside one of the Curly Braces or Blocks. We usually see i variable will be accessible only in the for loop and will not be accessible from outside. So to fix this in JavaScript, ES6 has introduced the let & const

* Global Block Bindings:-

The scope that is declared global or returns with a window object is called Global Block Bindings.
Global Block Bindings are usually declared out of function