const students = ['John', 'Mark'];
const weight = [92, 85]
const height = [1.88, 1.76]
function yourBodyMass(name, funct, mass, height) {
console.log(`${name} your BMI is ${funct(mass, height)}.`)
}
function bodyMass(mass, height) {
const BMI = mass / height ** 2;
return BMI;
}
function loopData() {
for (let i of students) {
return yourBodymass(students[i], bodyMass)
}
}
Now I want to loop through students so that I don't have to declare the yourBodyMass function again and again. Plz tell IF this is even possible.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/yKeT96C
Comments
Post a Comment