News for hackers. Stuff that matters.
Re:How true hackers write JavaScript by oh-kumudo on Wednesday September 05, 2018 @03:52AM (#17915905)
Your code is not more readable, it is just shorter.

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.

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.
Re:How true hackers write JavaScript by lghh on Wednesday September 05, 2018 @09:02AM (#17917468)
And I bet there are some people here using IE. And old browsers.
Re:How true hackers write JavaScript by Snd_ on Wednesday September 05, 2018 @10:14AM (#17918137)
I would REALLY love to see the browser usage statistics for HN :)
Re:How true hackers write JavaScript by yesenadam on Wednesday September 05, 2018 @11:39AM (#17918933)
Well.. I might be an outlier, I use OmniWeb and Camino as they give the best results with my 2005 Mac. So I'm still living in the Pre-=> Age.