Hacker News new | comments | show | ask | jobs | submit login
Partial Application in ECMAScript 2015 (raganwald.com)
12 points by jessaustin on Apr 1, 2015 | hide | past | web | favorite | 2 comments



For left partial application, you could use:

    const squareAll = mapWith.bind(null, x => x * x);
Am i missing something?


Most 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.




Applications are open for YC Winter 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: