I´m new to Javascript, I´m trying to filter an array of objects through one of the object properties (to get the object that has the biggest value of said property. How would I go about to doing that?
Just to clarify, this is an example, imagine the three "amount" properties have different values, and I want to get the biggest one:
let object = {
names: name,
amount: 3,
}
let objectArray = [object, object, object];
I tried to use the .filter() method, but don´t know how to apply it to a property like I want to