Quote:
Originally Posted by khortez
PHP Code:
player.chat = "Boots" SPC (this.boots ? "on!" : "off!");
in a script like that, i can see where true is defined, but...
PHP Code:
player.chat = "Boots "@ ((this.boots = !this.boots)? "on!" : "off!");
where exactly was it defined in this?
|
in some languages, the entire assignment operation [e.g.
(this.boots = !this.boots)] returns a value: the value of the left hand side of the equation after the assignment takes place.
In other words, the value of
PHP Code:
(this.boots = !this.boots)
is equal to the value of
this.boots after it is set to
!this.boots
edit: I wouldn't worry about all of these little "shortcuts" right now. They make your code less clear, and as someone who is still learning, it is better to be as straight forward as possible.