(Edit: I found this syntax while reading someone else's code)
Is there any good reason for using the following syntax for setting a variable in javascript:
this.index >= this.items.length && (this.index = 0);
Is it just to get the expression on one line of code, or is there another, dare I say better, reason for this way of doing it...
Edit: The code is equivalent to:
if (this.index >= this.items.length) {
this.index = 0;
}