News for hackers. Stuff that matters.
Re:Why I sometimes hate JavaScript by d4n3 on Friday February 27, 2015 @09:21AM (#9118917)
It's way better to use [values].join('') here... It's probably faster and it coerces all values to string.

If the first couple of results were numbers or booleans, they would be summed:

    > true + 10 + " result"
    11 result

    > [true,10," result"].join('')
    true10 result
Re:Why I sometimes hate JavaScript by mschoebel on Friday February 27, 2015 @09:23AM (#9118930)
All the functions in that code return numbers.
Re:Why I sometimes hate JavaScript by alexsop2 on Friday February 27, 2015 @09:26AM (#9118954)
Making [`.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...) a significantly better choice.
Re:Why I sometimes hate JavaScript by d4n3 on Friday February 27, 2015 @09:26AM (#9118951)
Ah ok. At first glance it looked like he was putting together something like an url.