So This switch Statement Is Broken... Let’s Fix It
Jul 7, 2025 · 2 min read · I was working on some JavaScript logic with a friend and wrote this: let age = 18 switch (age) { case age < 13: console.log("child") break; case age<18: console.log("Teenager") } Oops. Didn’t work. ❓ So What’s the Problem? Turns out ...
Join discussion