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 fb74158 commit 08c4269Copy full SHA for 08c4269
Sprint-2/3-mandatory-implement/1-bmi.js
@@ -11,10 +11,14 @@
11
12
function calculateBMI(weight, height) {
13
let bmi = (weight / (height * height));
14
- return bmi.toFixed(1);
+ return Number(bmi.toFixed(1));
15
}
16
console.log(calculateBMI(70, 1.73));
17
console.log(calculateBMI(95, 1.82));
18
console.log(calculateBMI(52, 1.6));
19
console.log(calculateBMI(110, 1.75));
20
-console.log(calculateBMI(65, 1.9));
+console.log(calculateBMI(65, 1.9));
21
+
22
+console.assert(typeof calculateBMI(60, 1.65) === 'number', 'Should return a number');
23
+console.assert(calculateBMI(60, 1.65) === 22.0, 'Should correctly calculate BMI');
24
+console.log('All tests passed!');
0 commit comments