DEV Community

Discussion on: If/else or just if?

 
tyrw profile image
Tyler Warnock

Normally no, but in this case yes. It's a bare-bones project and the code is constructing a DB query from a set of known inputs, so null and undefined get treated as null, strings get quotes around them, and everything else is passed through.