Welcome, All,

I came with new and most important tutorial named ECMAScript6 That is ES6. It is also known as ECMA2015. We will have been seen about Es5. Es6 is the extension of es5. You know very well all about Es5 but today I will discuss all new features of Es6, So let see:-

There are many topics to discuss in Es6. First, we see what is the most important topics are included in Es6.

  1. Scoping
  2. Destructing
  3. Promises
  4. Arrow Function
  5. Set & map
  6. Rest Parameter
  7. Class & Modules

First of all, we see how to define a default value in functional parameters.

How to define default value in functional parameters.

These features are already available in es5 that is How to define default value when there will not pass any kind of parameter by a user in a Functional parameter.

// For Example, we have a simple function named ‘saySomething’ which contains a single parameter named ‘msg’ condition is that if any user passes the argument then ok but if he does not pass any argument that how can we assign a default value.

// Example of Es5


But in Es6 we have given to new concept to assign a Default value in the functional parameter. That is in Es6 How to define default value of parameter if user has not been given the case we define in-line code that put the default value then case if user pass its own parameter value then that will be assign and display but in case User has not been assign any kind of parameters values then its own default value will be assign who has already given on the in-line argument value.

// Example of Es6


Scoping – Understanding of let, var and const

If we create any variable with the help of var then that variable has a function scope and we create multiple variables as the same name with the help of var That is wrong because sometimes we create multiple variable with same variable name with the help of var then case the last variable is overriding that value because all variable we create with the help of var is called a function scope.

For Example we create an Anonymous function and make a simple variable named x with the help of var and assign value in x = 10 and I check condition that if x is then case we make new variable as the same name x and put the value 11 and come to the out of if block and print the value of x then What is the Output :-

// Var


To overcome that problem of var there will be new concept would be define named let. If we are using let keyword then it provides us block label scope that why we can get output according to our requirement. So let we can see the same example with the help of let:-

//  let


Const keyword is new features of Es6. const gives us to facilitate to make the variable which can not be modified

// const



This is the very good feature in Es6. It is very simple to understand and we are going to understand the main features named De-structuring. If we want to retrieve an individual value from the number then case De-structuring is more important to us. let see one simple Example:-


Fat Arrow Function ( => )

Fat Arrow function is the most important and valuable function in Es6. It helps us to give the easier concept to making any function. let we see a simple example to explore of fat arrow function:-




Rest Parameter

Rest parameter is also a most important topic in Es6. We can say The rest parameter syntax allows us to represent an indefinite number of arguments as an array. If we make Rest parameter in any function when the condition is that any user doesn’t know that how many parameters will be pass in the function then Rest parameter will help us because it holds any number of argument in a function parameter list. let see in the example that how to implement that Rest parameter how to work:-



JavaScript classes provide a much simpler and clearer syntax to create objects and deal with inheritance. Class concept is new for the Es6. It helps to more understandable and more reliable to make implementation. We have to give permission to make a constructor and function in a class level block to simplify modification and interaction in programs. Let see the example to more deeply understand of classes



Thanks for reading…….