apply

apply :: (Function fn, Array args) => Any value

description

Returns the result of calling the provided function with its arguments, which are passed as an array. apply works very similarly to Function.prototype.apply, with the notable difference that you can not provide a value for this. apply(f, args) is equivalent to f(...args), using ES6's spread operator.

example

import { apply } from 'conductor'

const numbers = [2, 1, 8, 3, 12]

apply(Math.max, numbers) // 12

Last updated