showing results for - "js bmi calculator"
Mariangel
04 Jun 2017
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);