I'm trying to write a function, but it's doing the opposite of what I'd like.
Write a function that determines whether a user is old and tall enough to ride a roller coaster. The function should take an object as a parameter. If the object's age property is greater than or equal to 7 and the height property is greater than or equal to 42, return true. Otherwise, return false
const rollerCoaster = (object) => {
if (object.age >= 7 && object.height >= 42) {
return true
} else {
return false
}
}
console.log(rollerCoaster(55, 55));
This is returning false, we want it to return true. What am I missing?
Aucun commentaire:
Enregistrer un commentaire