Skip to content

Commit 4064cd8

Browse files
author
russom
committed
Implement a BMI calculating function
1 parent 8245202 commit 4064cd8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 1 deletion
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 a string of their Body Mass Index to 1 decimal place
1616

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

0 commit comments

Comments
 (0)