This is exactly the same behavior as when you write if (a && b) or if (a || b) in Python, JavaScript, etc. By the way, there is also an operator called ! (NOT ...