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
}
5
solved OR and AND operator confusion in Javascript [closed]