functionally
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -397,2 +397,8 @@ /** | ||
maxArgs = function(fn, count){ | ||
return function(){ | ||
return fn.apply(this, SLICE.call(arguments, 0, count)) | ||
} | ||
}, | ||
spread = function(fn, delay, scope){ | ||
@@ -628,2 +634,4 @@ | ||
maxArgs: curry(maxArgs), | ||
/** | ||
@@ -630,0 +638,0 @@ * @method compose |
{ | ||
"name": "functionally", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -79,1 +79,13 @@ Functionally | ||
## maxArgs(fn, count) | ||
If you use parseInt as the parameter to array.map, you get an undesired result | ||
```js | ||
['1','2','3'].map(parseInt) | ||
//[1, NaN, NaN] | ||
``` | ||
But if you use maxArgs: | ||
``` | ||
var parseInt = F.maxArgs(parseInt, 1) | ||
['1','2','3'].map(parseInt) | ||
//you get [1,2,3], the expected result |
Sorry, the diff of this file is not supported yet
59670
18
713
90