3 ms·
It's just a way of getting rid of the redundant "function()" syntax. Unfortunately with bind(), we have to set the scope even though it isn't always necessary.
by xhrpost 13y ago
It's just a way of getting rid of the redundant "function()" syntax. Unfortunately with bind(), we have to set the scope even though it isn't always necessary. So in this case, the first parameter "this" is also probably redundant. The old PrototypeJS curry() would have been the least redundant solution:
movePlayer.curry("north")
- k3n 13y agoThere's also partial(): 1. http://documentcloud.github.io/underscore/#partial http://documentcloud.github.io/underscore/#partial