News for hackers. Stuff that matters.
Re:Using the switch(true) pattern in JavaScript by IggleSniggle on Monday April 12, 2021 @04:54PM (#26785041)
My preference for this is to use an assertion function, eg in nodejs:

assert(isDefined(user),”User must be defined”) // throws if Falsy

There are no comments on this comment yet.