
There is a drawback to this import syntax: it cannot be used inside a script tag (since it's a synchronous tag) and you cannot conditionally load a module. Having both named exports and a default export in the same module is also possible, and it looks like this: // module.js

sau importă toate exporturile denumiteĭefault exports have a sweet and short syntax: If the arrow function only needs one argument, you can also get rid of the opening and closing parentheses from the arguments list. Here's a short example: // es6 versionĪs you can see, we dropped the "function" keyword, which already saves us some characters, but it gets even better. If you are a programmer with a preference for functional programming you will definitely love it. Some new major features Arrow functionsĪrrow functions are a new, shorter way to write anonymous functions. Of course, depending on the type of the project you may find other features useful. I will discuss below some of the improvements which I personally like and think will help me most. Actually, the official name is ECMAScript 2015, but it seems that in the community ES6 is still the version that most people recognize (at least for now). ECMAScript 6 (ES6), on the other hand, has finally introduced features developers were waiting for years.


The previous edition of the standard, ECMAScript 5, was released at the end of 2009, with significant improvements to the language, but it was still lacking some important features. For those of you who haven't heard of ECMAScript, simply put, ECMAScript is the standard which defines the programming language which we popularly know as JavaScript.
