4 ms·
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. An
by goto11 5y ago
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!
- LAC-Tech 5y agowell yeah I could also write a function in C that does that. I don't think that's the point.