Skip to content

Commit 54b7be8

Browse files
Alex JamshidiAlex Jamshidi
authored andcommitted
updated to the power of, from ^ to **
1 parent 8f6c8dd commit 54b7be8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
// It should return their Body Mass Index to 1 decimal place
1616

1717
function calculateBMI(weight, height) {
18-
return (weight / (height ^ 2)).toFixed(1);
18+
return (weight / height ** 2).toFixed(1);
1919
}
20+
21+
console.log(calculateBMI(70, 1.73));
22+
console.log(calculateBMI(50, 2));

0 commit comments

Comments
 (0)