Tim Ruffles oi at
Sun Oct 4 15:06:41 UTC 2015

It'd be nice to add Function.prototype.partial, which is exactly like
`.bind` without the `this`-setting first argument.

Adding it would have benefits:

- `.bind(null, ...` is newbie confusing and ugly in functional code[1]
- `.bind(null, ...` is a very common idiom[2]
- `.partial` is intention revealing: it's clear you're writing functional
code that doesn't care about `this`

Adding it seems low cost, and is backwards compatible:

- implementors could literally make it a proxy to `.bind` if they want to
get it done fast
- shimmable
- not new functionality, just a subset of existing functionality




- [1] I've been teaching newbies Javascript/Node.js for years, and if you
take a 'functions first' approach it's complexity you have to tell them to
- [2] see github -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list