1// function that caclulates BMI
2function bmiCalc(weight, height){
3
4 var bmiResult = weight / Math.pow(height, 2);
5 var roundedResult = Math.floor(bmiResult);
6
7 return roundedResult;
8}
9
10
11// sample use
12var bmiCalcResult = bmiCalc(65, 1.8);
13console.log(bmiCalcResult);