Skip to content

Commit

Permalink
Clarify that _.bind and _.partial can be used together (#2328)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed Dec 16, 2021
1 parent d9e0091 commit 7c2db70
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions index.html
Expand Up @@ -1471,11 +1471,14 @@ <h2 id="functions">Function (uh, ahem) Functions</h2>
<p id="partial">
<b class="header">partial</b><code>_.partial(function, *arguments)</code>
<br />
Partially apply a function by filling in any number of its <b>arguments</b>,
<i>without</i> changing its dynamic <tt>this</tt> value. A close cousin
of <a href="#bind">bind</a>. You may pass <tt>_</tt> in your list of
<b>arguments</b> to specify an argument that should not be pre-filled, but
left open to supply at call-time.
Partially apply a function by filling in any number of its
<b>arguments</b>, <i>without</i> changing its dynamic <tt>this</tt>
value. A close cousin of <a href="#bind">bind</a>. You may pass
<tt>_</tt> in your list of <b>arguments</b> to specify an argument that
should not be pre-filled, but left open to supply at call-time.
<i>Note: if you need <tt>_</tt> placeholders and a <tt>this</tt>
binding at the same time, use both <tt>_.partial</tt> and
<tt>_.bind</tt></i>.
</p>
<pre>
var subtract = function(a, b) { return b - a; };
Expand Down

0 comments on commit 7c2db70

Please sign in to comment.