We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 734cbfe commit 68330f6Copy full SHA for 68330f6
Sprint-2/3-mandatory-implement/1-bmi.js
@@ -15,8 +15,8 @@
15
// It should return their Body Mass Index to 1 decimal place
16
17
function calculateBMI(weight, height) {
18
- height = height * height;
19
- return weight / height;
+ const bmi = weight / (height ** 2);
+ return Number(bmi.toFixed(1));
20
}
21
22
-console.log("Your BMI is: " + calculateBMI(70, 1.73).toFixed(1))
+console.log("Your BMI is: " + calculateBMI(70, 1.73))
0 commit comments