fr
fr

Question from the Javascript - Fundamentals test

Write a switch statement that checks if a person can go down a slide based on their weight and height.

Medium

What does the following code return?

let weight = 42;
let height = 1.50;
        switch (weight< 40)
        {
        case false :
            console.log("You can slide !");
         
        default : 
            if(height> 1.60) {
                console.log("You can go!");
            } else {
                console.log("Prohibition to go down the slide");
}
}
Author: KahinaStatus: Published(Update)Question passed 3938 times
Edit
9
Community Evaluations
developer avatar
Heinz
21/01/2025
le piege " case false :"
developer avatar
Auteur anonyme
31/01/2025
Ahaha le break;