3 ms·
For left partial application, you could use: const squareAll = mapWith.bind(null, x => x * x); Am i missing something?
by srgpqt 12y ago
For left partial application, you could use:
const squareAll = mapWith.bind(null, x => x * x);
Am i missing something?
- deleted 12y ago[deleted]
- picks_at_nits 12y agoMost of the time, you are not missing anything, and `bind` is faster and simpler. But if you would like to perform left partial application on methods, event handlers, or other functions where `this` is meant to be bound dynamically, the given solution works for both sets of cases.