Skip to content

Commit f5b79bf

Browse files
author
Payman IB
committed
Implement BMI calculation function and log result
1 parent 7ea670b commit f5b79bf

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+
const bmi = weight / (height * height);
20+
return bmi.toFixed(1);
21+
}
22+
console.log(`The BMI of a person weighing 70kg and 1.73m tall is ${calculateBMI(70, 1.73)}`);

0 commit comments

Comments
 (0)