Quick actions

cmd+k|ctrl+k

Navigation

Languages

bmiCalc

Snippet info

Language

JavaScript

Visibility

public

Author

jamesdrums

Created

2025-10-27T00:25:14.53719Z

Updated

2025-10-27T00:26:29.335254Z

//Create your function below this line.
//The first parameter should be the weight and the second should be the height.
function bmiCalculator(weight, height) {
    var bmi = Math.round(weight / Math.pow(height, 2));
    console.log(bmi)
    return bmi
}

bmiCalculator(65, 1.8)

/* If my weight is 65Kg and my height is 1.8m, I should be able to call your function like this:

var bmi = bmiCalculator(65, 1.8); 

bmi should equal 20 when it's rounded to the nearest whole number.

*/
INFO