DEV Community

Discussion on: How to find the max id in an array of objects in JavaScript

Collapse
 
quirinus profile image
Ivan Jelenić • Edited

The best solution for big sets
of data is, in my opinion, to just update a variable with max as you add new data.

Then you don't even have to loop anything.

For small data sets, it doesn't even matter.