This question already has an answer here:
- What's the meaning of “=>” (an arrow formed from equals & greater than) in JavaScript? 10 answers
I was reading the source for ScrollListView and in several places I see the use of () => {}
.
Such as on line 25,
this.cellReorderThreshold = () => {
var ratio = (this.CELLHEIGHT*this.cellsWithinViewportCount)/4;
return ratio < this.CELLHEIGHT ? 0 : ratio;
};
line 31,
this.container.addEventListener('scroll', () => this.onScroll(), false);
line 88.
resizeTimer = setTimeout(() => {
this.containerHeight = this.container.offsetHeight;
}, 250);
Is this a shorthand for function
and if it differs in any way, how so?