function calculateBMI(weight, height) {
const heightInMeters = height / 100;
return weight / (heightInMeters ** 2);
}
const weight = 70;
const height = 175;
const bmi = calculateBMI(weight, height);
console.log('BMI:', bmi);
code
Calculating BMI (Body Mass Index) in JavaScript
BMI calculation
calculateBMI function
weight
height