News for hackers. Stuff that matters.
Re:Using the switch(true) pattern in JavaScript by 8128js8121 on Monday April 12, 2021 @06:11PM (#26785814)
``` switch (true) { case 1 + 1 === 2: // This case evaluates to true so it will be executed default: // This will not be executed } ```

This is wrong, Since there is no return or break default will also be executed.

There are no comments on this comment yet.