It basically works like this.
By default this.whatever equals null or 0 because you haven't assigned anything to it, It also is a Boolean, which means it can be true or false, eg 0 or 1.
So when you put:
PHP Code:
this.whatever = !this.whatever;
It basically just toggles it.