Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

max value javascript

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]
  }
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #max #javascript
ADD COMMENT
Topic
Name
9+6 =