3 min readMay 6, 2021


ES6 and other features of JS

  1. Hoisting :Let’s talk about what is hoisting . Hoisting is you can use variable before it has been declared .It’s only support for var keyword not for const and let keyword. Hoisting is a default behavior of js.By the hoisting is not global variable . Hoisting is local variable.

2.Try and catch :Bugs and errors are unavoidable in programming .It will happen .To handle this we need to try and catch . The main code put inside the try block . If code got any error it will not be executed and catch block will be executed . If code has no error it be executed in try block and catch block will be skipped.

3.Throw : Throw statement is used to create a custom error .It helps to generate user defined custom error.

4.Finally : Finally statement will be always executed , no matter code got bugs or not .

5.Function with default parameters :In java script default function parameters allowed named parameters to be initialized with default value if parameter value is missing . So it’s better to pass default value .

6.Arrow function : ES6 introduced arrow function which allow us to declare function in cleaner and shorter way as compare to regular function.

7.Spead operator : It is a feature of ES6 , which allow to spread or expand an iterable and array .

8.Block level function : This function is the feature of ES6 . Function only will access inside the block means in the curly braces ‘{}’.Outside block can not be used .

9.Block-level-declaration : Block-level-declaration is declare variable or function inside a block {}, can not be access from outside of block . var keyword can not be block level declaration.

10.Block binding in loop :

In for loop if variable declared with var keyword ,we can access it from outside of the loop .To solve this problem we can use let or const keyword.