ES6 is basically advance version of javascript also known as ecmascript 6.
Here we learn following new things about javascript
Now before I give some examples of ES6 script syntax, I want to make sure you have some script editor installed on your local system, because new JavaScript 6 syntax may not be supported in your regular html editor, I recommend you to install VS Code edit for Nude.Js where you can write ES6 syntax or you can use ES6 Console
ES6 Syntax Example default value of unitprice is 10, so if no unitprice is assigned the default value will be considered
function cacuatePrice(quantity , unitprice=10 )
{
return quantity * unitprice;
}
cacuatePrice(50);
We can call the function with only mandatory parameter also.
Here you will be learning below topics