What does this line parent && (this.parent.next = this);
mean?
It just looks like its sitting there, doing nothing, not an if statement or a promise or anything. Is there a name for this style of coding?
var Particle = function(i, parent)
{
this.next = null;
this.parent = parent;
parent && (this.parent.next = this);
this.img = new Image();
this.img.src = "http://www.dhteumeuleu.com/images/cloud_01.gif";
this.speed = speed / this.radius;
}
Its in multiple places in this animation file I'm looking at. Here's another example.. (!touch && document.setCapture) && document.setCapture();
this.down = function(e, touch)
{
e.preventDefault();
var pointer = touch ? e.touches[0] : e;
(!touch && document.setCapture) && document.setCapture();
this.pointer.x = pointer.clientX;
this.pointer.y = pointer.clientY;
this.pointer.isDown = true;