I am newbie at the Javascript and i just trying to learning functions it's a little bit hard but i do my best :). I am doing a function to calculate bmi like this ;
let calculateWeight = parseFloat(prompt("Enter your weight", ))
let calculateHeight = parseFloat(prompt("Enter your height?"))
function calculateBmi(weight, height) {
let bmi = weight / (height * height)
if (bmi < 18.5) {
console.log("You are underweight")
} else if (bmi > 18.6) {
console.log("You are normal weight")
} else if (bmi > 25) {
console.log("you are overweigh")
}
return bmi;
}
console.log(calculateBmi(calculateWeight, calculateHeight))
if i enter my values 72 weight and 1.80 kilos it says you are normal weight yeah it's correct but whenever i enter my values >25 it's says again you are normal weight where am i doing wrong ?