DEV Community

Cover image for 1 line of code: How to get biggest numeric item of an Array
martin krause
martin krause

Posted on

1 line of code: How to get biggest numeric item of an Array

const biggestItem = arr => Math.max(...arr); 
Enter fullscreen mode Exit fullscreen mode

Returns the biggest numerical item of the array.


Happy coding and consider to buy me a coffee

Photo by zoo_monkey on Unsplash


Discussion (0)