Check if a variable is of function type

后端 未结 18 1431
北海茫月
北海茫月 2020-11-22 15:37

Suppose I have any variable, which is defined as follows:

var a = function() {/* Statements */};

I want a function which checks if the type

18条回答
  •  有刺的猬
    2020-11-22 16:17

    jQuery (deprecated since version 3.3) Reference

    $.isFunction(functionName);
    

    AngularJS Reference

    angular.isFunction(value);
    

    Lodash Reference

    _.isFunction(value);
    

    Underscore Reference

    _.isFunction(object); 
    

    Node.js deprecated since v4.0.0 Reference

    var util = require('util');
    util.isFunction(object);
    

提交回复
热议问题