function bmival(h, w) {
var b = h * 2;
var o = w / b
// var r= Math.trunc(o)
return (`Your BMI is ${o}`)
if (o < 18.5) {
return 'you are underweight'
} else if (o > 18.5 && o < 25.5) {
return 'You come under fit category'
} else {
return 'you are overweight and obese'
}
}
console.log(bmival(1.895, 70))
The if
statement not returning the string i was making a Bmicalculator and don't know what i am doing wrong