I’m learning Backbone and had some issues with the on()-function. But actually it’s a very basic JavaScript question.
Why is it that the first line of code below works, and the second doesn’t?
Using the second line, the render-function is never triggered. Mind the brackets.
Works
this.collection.on( 'reset', this.render, this );
Fails
this.collection.on( 'reset', this.render(), this );
this.render()executes function (so in your case you are passing data returned from this function), whereasthis.renderis handler to function.