|
ECMASCript/JavaScript Debugging
Using Firebug |
|
Prof. David Bernstein |
| Computer Science Department |
| bernstdh@jmu.edu |
in the toolbar
:
:
:
:
this
/**
* A function to calculate and display the body mass index (BMI)
*
* @param {number} weight - The weight in pounds
* @param {number} height - The height in pounds
*/
function calculateBMI(weight, height)
{
"use strict"; // ECMAScript 5
var bmi;
bmi = weight / (height * height) * 703;
if (bmi < 15){
bmi = 15;
}else if (bmi > 60){
bmi = 60;
}
return bmi;
}