main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
846 bytes
|
Line | |
---|
1 | var _curry2 =
|
---|
2 | /*#__PURE__*/
|
---|
3 | require("./internal/_curry2.js");
|
---|
4 | /**
|
---|
5 | * Applies function `fn` to the argument list `args`. This is useful for
|
---|
6 | * creating a fixed-arity function from a variadic function. `fn` should be a
|
---|
7 | * bound function if context is significant.
|
---|
8 | *
|
---|
9 | * @func
|
---|
10 | * @memberOf R
|
---|
11 | * @since v0.7.0
|
---|
12 | * @category Function
|
---|
13 | * @sig (*... -> a) -> [*] -> a
|
---|
14 | * @param {Function} fn The function which will be called with `args`
|
---|
15 | * @param {Array} args The arguments to call `fn` with
|
---|
16 | * @return {*} result The result, equivalent to `fn(...args)`
|
---|
17 | * @see R.call, R.unapply
|
---|
18 | * @example
|
---|
19 | *
|
---|
20 | * const nums = [1, 2, 3, -99, 42, 6, 7];
|
---|
21 | * R.apply(Math.max, nums); //=> 42
|
---|
22 | * @symb R.apply(f, [a, b, c]) = f(a, b, c)
|
---|
23 | */
|
---|
24 |
|
---|
25 |
|
---|
26 | var apply =
|
---|
27 | /*#__PURE__*/
|
---|
28 | _curry2(function apply(fn, args) {
|
---|
29 | return fn.apply(this, args);
|
---|
30 | });
|
---|
31 |
|
---|
32 | module.exports = apply; |
---|
Note:
See
TracBrowser
for help on using the repository browser.