So this may sound dumb, but I am a fairly novice JS dev and I see in your last example you chained…
Justin Foss
3

You can call bind on any function, including a function literal.

This is what he is doing, which is entirely valid:

function(){ … }.bind(this)

The call will return a new function, like the old function but this one has its context “bound” to the object that was provided (in this case, `this`).

Show your support

Clapping shows how much you appreciated Joey Twiddle’s story.