Skip to content

Commit b380c10

Browse files
committed
Implement BMI calculation function and add test cases
1 parent dda6132 commit b380c10

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@
1616

1717
function calculateBMI(weight, height) {
1818
// return the BMI of someone based off their weight and height
19-
}
19+
return (weight / (height * height)).toFixed(1);
20+
}
21+
console.log(calculateBMI(70, 1.73));
22+
console.assert(calculateBMI(80, 1.73) === '26.7');

0 commit comments

Comments
 (0)