I need to return the object but also the object with the highest price,
i need to return the entire object with the highest price book.
Can someone check my work
I need to return the object but also the object with the highest price,
i need to return the entire object with the highest price book.
Can someone check my work
Instead of keeping track of currentPrice
, it’d be better to keep track of a current book, and compare its price on each iteration.
The current book could be setup with either a fake book, as suggested in the notes, or it could start with the first (or any) book in the array.
Good luck!