[Solved] OR and AND operator confusion in Javascript [closed]


If it helps you to understand, you can rewrite it from AND to OR:

while (command != "quit" && command != "q") {
  // do job
}

is equivalent to

while (!(command === "quit" || command === "q")) {
  // do job
}

https://en.wikipedia.org/wiki/De_Morgan%27s_laws

5

solved OR and AND operator confusion in Javascript [closed]