I expected it to be the first case, but why the default came in the result?

Viewed 19

I expected it to be the first case, but why the default came in the result?

let age = 19;

switch (age) {
    case age>=18:
        console.log("You are adult");
        break;

    default :
        console.log("You are teenager");
    }

0 Answers
Related