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



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.




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

Search: