Skip to content

call

Call a single function or multiple functions (passed as an array) and pass arguments to them.

Usage

ts
import { call } from 'rattail'

call((a, b) => a + b, 1, 2)
// return 3
call([(a, b) => a + b, (a, b) => a + b], 1, 2)
// return [3, 3]

Arguments

ArgTypeDefaults
fnFunction | Function[]
...argsany[]

Return

Type
Function