mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
allowing bind with undefined contexts, but with arguments
This commit is contained in:
@@ -308,7 +308,7 @@
|
|||||||
// Create a function bound to a given object (assigning 'this', and arguments,
|
// Create a function bound to a given object (assigning 'this', and arguments,
|
||||||
// optionally). Binding with arguments is also known as 'curry'.
|
// optionally). Binding with arguments is also known as 'curry'.
|
||||||
_.bind = function(func, context) {
|
_.bind = function(func, context) {
|
||||||
if (!context) return func;
|
context = context || root;
|
||||||
var args = _.toArray(arguments).slice(2);
|
var args = _.toArray(arguments).slice(2);
|
||||||
return function() {
|
return function() {
|
||||||
var a = args.concat(_.toArray(arguments));
|
var a = args.concat(_.toArray(arguments));
|
||||||
|
|||||||
Reference in New Issue
Block a user