[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]

[Solved] C# logical comparison with || or &&

It is just logic: whole expression combined by and is true only when both parts are true. So when your loop met first : character, expression is false and loop has been stopped. Based on your description, your code should look like while (!(json[z-2] == ‘s’ && json[z] == ‘:’)) { z++; } or equivalentely … Read more