function findBestItem(items) {
var bestItem = null;
var bestValue = 0;
var itemsIndex = 0;
// Loop over the items array.
// Find the item with the highest valueOverDistance()
while (itemsIndex < items.length) {
}
return bestItem;
}
It’s sort of sad, but I got stuck here. What do I do? I know I want to find the highest item valueOverDistance, but how do I do see which item has that?
Find the best item using valueOverDistance by comparing valueOverDistance with bestValue. If valueOverDistance is larger than bestValue then oh this is exactly what @jka2706 said. Sorry I didn’t read her post properly.