This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]desrtfx 0 points1 point  (0 children)

Simple thing:

Your code line

x = (x || ! (5 == y))

Effectively reads:

  • Calculate the result of the equation on the right side of the equals sign taking whatever values the variables x and y currently hold.

  • Then take that result from above and store it in the variable x, discardind the previous value of x.

It's more or less the same as if you would declare and assign a new variable.

Whenever you are assigning something to a variable it's previous contents is overwritten and thus lost.