The intention of the body code seems to be to run
else through all of the
if statements above, and when none of them exist. However, the
if statement does not work like that.
else is only associated with the previous
if or the previous
The code above looks like an ideal chain condition.
By linking conditional statements in this way, of course, the syntax inside
if will only be executed when the conditions are right. However, all
if except for the last are separate conditions that are not related to
In other words,
else is executed as long as
if is false just above it, no matter how it was executed above it.
© 2022 pinfo. All rights reserved.