Can I simplify this conditional statement, which uses the logical negation operator?

advertisements

Sorry if this is a "Logical Operators 101" kind of question. I've been staring at my screen for 15 minutes trying to wrap my head around it, but I'm stuck.

Is there a more concise/elegant way to phrase the following (this is JavaScript syntax, but it's not a language-dependent question):

if (!something && !something_else) {
  // do something
}

Based on some experimentation, this does not appear to be the logical equivalent:

if (!(something && something_else) {
  // do something
}

In addition, can anyone recommend an online resource(s) for further study on questions like these? I'm assuming that this type of thing is covered on an abstract level in computer science curricula, and it's an essential gap in my programming knowledge that I'd really like to fill. Thanks!


(Not A) And (Not B)

is equivalent to:

Not (A Or B)

It's an application of De Morgan's laws