Hacker News new | ask | show | jobs
by LAC-Tech 1772 days ago
IIRC the spread syntax only works with relatively small arrays, because it's function application at the end of the day.

So worthwhile keeping in mind that the nice JS code falls apart.

1 comments

Fair point. In any case, if you wanted to do more than trivial array processing in JS, you would use a library like lodash which have an array max function.

And if you think lodash is still to verbose, you can define your own:

  const å = list => list.reduce((x,y) => Math.max(x, y));
Now you can write å(list) to get the max value of an array!
well yeah I could also write a function in C that does that. I don't think that's the point.