Skip to content

Commit 863b7a8

Browse files
committed
Update to mandatory-implement\1-bmi.js to change height^2 which is not an exponent in JS to heightxheight
1 parent b5f1e22 commit 863b7a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

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

1717
function calculateBMI(weight, height) {
1818
// return the BMI of someone based off their weight and height
19-
const bmi = weight / (height ^2);
19+
const bmi = weight / (height * height);
2020
return Math.round(bmi * 10) / 10;
2121
}
2222
console.log(calculateBMI(70, 1.73)); // should return 23.4

0 commit comments

Comments
 (0)