Function isFn

  • 检查是否为 function

    Parameters

    • value: any

    Returns boolean

    isFn(function(){}); /// true
    isFn(async function(){}); /// true
    isFn(new Promise((resolve, reject) => resolve()); /// false
    isFn({}); /// false