let x = Number.MAX_VALUE;
//Returns number with highest value.
var x = Math.max(-5, 12, 27);
console.log(x)//27
x = findMax(1, 123, 500, 115, 44, 88);
function findMax() {
var i;
var max = -Infinity;
for (i = 0; i < arguments.length; i++) {
if (arguments[i] > max) {
max = arguments[i];
}
}
return max;
}
if (penyakit === 'flu'){
let obatFlus = database.flu.obat
obatTermurah = ''
cheapest = Number.MAX_VALUE
for (let i = 0; i < obatFlus.length; i++){
let fluObat = obatFlus[i]
let obatName = fluObat[0]
let obatPrice = fluObat[1]
if(obatPrice < cheapest){
obatTermurah = obatName
cheapest = obatPrice
}
}
output = [obatTermurah, cheapest]
}