# Finding a Good Deal explainer

How the program exactly finds the value ? In the compare to maximum function because we didn’t declared anything, like value = flight prices then how the program identify the value we declared??

There is a part of this I don’t understand, the initial max value is the first element in the array(Lets say its 200). When the compareToMaximum function iterates through the flightPrices array and starts at the first element in the array, what does the max value give us true or false;
value=200
initial max= 200
max= value>max?value:max;
max=200>200?
How does it evaluate this? Is it as true or false

can someone please a screen short of how to do it please

pliz help me by sending a screen short l cant understand it

[spoiler]```
import { flightPrices } from ‘grasshopper.travel’;

let max = flightPrices[0];
let min = flightPrices[0];

function compareToMaximum(value) {
max = value > max ? value : max;
}

function compareToMinimum(value) {
min = value < min ? value : min;
}

console.log(flightPrices);

flightPrices.forEach(compareToMaximum);
console.log('Maximum: ’ + max);

flightPrices.forEach(compareToMinimum);
console.log('Minimum: ’ + min);

``````