hey guys i was just going through the code of carasoul.js and came across the following function .
Carousel.prototype.cycle = function (e) {
e || (this.paused = false)
this.interval && clearInterval(this.interval)
this.options.interval
&& !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this
}
can somebody tell me why the check on e in the 1st line of the function ? i have seen this in almost most of the bootstrap plugins . can somebody explain the significance of this check ? and where us e being passed from ??
The two things i found out is cycle get's called from the function Plugin , on line 186 and e if console logged gives the following output :
Object { originalEvent: mouseover, type: "mouseover", isDefaultPrevented: bb(), timeStamp: 0, jQuery1112044026608114512766: true, toElement: undefined, screenY: 407, screenX: 643, pageY: 310, pageX: 643, 23 more… }
the Entire plugin can be here.
EDIT :: I was specifically asking "WHY" , not "What is e" , also my question is more contextual and relates to a code convention of a popular framework,(bootstrap3.2+) , i am not asking a beginner question as to how ?
Thank you .
Alex-z