UNPKG

call-function

Version:

Invoke function if is it callable and return result otherwise undefined

7 lines (6 loc) 124 B
export const call = (...args) => { const fn = args.shift() if (typeof fn === 'function') { return fn(...args) } }