Skip to content

Commit c8332fb

Browse files
committed
Implement calculateBMI function in 1-bmi.js
1 parent 845fd56 commit c8332fb

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Sprint-2/3-mandatory-implement/1-bmi.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
// Then when we call this function with the weight and height
1515
// It should return their Body Mass Index to 1 decimal place
1616

17+
//------------------------------------------------------------------------------------------
18+
1719
function calculateBMI(weight, height) {
18-
// return the BMI of someone based off their weight and height
19-
}
20+
return Number((weight / height ** 2).toFixed(1));
21+
}
22+
console.log(calculateBMI(70, 1.73));

0 commit comments

Comments
 (0)