The first five functions in JavaScriptES6 are worth mastering.
JavaScriptES6 adds a series of new features to the JavaScript language, some of which are more groundbreaking and more applicable than others. Like ES6 classes, for example, although novel, syntactic sugar is added to existing JavaScript class creation methods, while features such as generators, while very powerful, are reserved for more specialized tasks.
From working on various JavaScript-related projects over the past 12 months, I have found that the five most important features of ES6 are essential because they really simplify the way common tasks in JavaScript are accomplished. Your top five may be different from mine, and if they are, I encourage you to share at the end of the comments section.
Let's go!
Arrowhead function
Promise
Asynchronous function
Deconstruction
Default and REST parameters
1) JavaScript Arrow function
One of my favorite new features in ES6JavaScript is not a new feature, but a refreshing new grammar set that makes me smile every time I use it. I'm talking about the Arrow function, which provides a very elegant and minimalist way to define anonymous functions in JavaScript.
In short, the Arrow function removes the "function" keyword and uses the arrow (= >) to change the parameter part of the function body of the function. Anonymous function:
one