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.applyarrow-up-right, 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 operatorarrow-up-right.

example

import { apply } from 'conductor'

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

apply(Math.max, numbers) // 12

Last updated