Re:How true hackers write JavaScript
by simplysh on Wednesday September 05, 2018 @08:37AM
(#17917334)
It's 2018. Unless you're using Internet Explorer arrow functions are supported natively.
And I bet there are some people here using IE. And old browsers.
I would REALLY love to see the browser usage statistics for HN :)
In fact, using the online babel transpiler, it transpiles the es6 version you provided precisely into hn's version:
https://bit.ly/2MPmjK7
To use es6 to achieve what this tiny piece of javascript could already do, you probably need to introduce some tremendous dependency like babel just to be compatible with all kinds of weird browsers out there. What does es6 give here? Not very much in my opinion.