3 ms·
Webpack/browserify remove/polyfill most of the ES6 syntax so it is backwards compatible for browsers. Server side you just need to be aware of your engine's sup
by dexwiz 11y ago
Webpack/browserify remove/polyfill most of the ES6 syntax so it is backwards compatible for browsers. Server side you just need to be aware of your engine's support of ES6.
The extra syntax around arguments (defaults and rest) is useful. ES5 does support function overload, but often ends up some hard to read hacks. Libraries commonly have only a few functions, but the functions have flexible signatures. So the first thing you see when trying to read their source is a jumble of argument parsing.
That said, ES6 can end up with some poor performance. For example, template literals are almost 10x slower than just plain string concatenation. But if you are concerned with performance, writing JS may not the be the best choice.