I was looking at some compiled coffee code script, and I noticed something like the following, which in my opinion was really strange:
var current, x = 8; current = this._head || (this._head = x);
after doing this, the current has a value of 8. Judging by the fact that || the boolean operator works, I would expect it to evaluate the left side first. Having received "undefined" on the left side, it moves to the right, where it assigns this._head to 8. Then it returns true, but is this part not so important? I donβt see how it can return and affect the βcurrentβ variable? Any help would be appreciated, thanks!
source share