欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

常用工具判断-isFunction

程序员文章站 1970-01-01 07:55:48
...

 

判断对象是否是function

 

   先看看prototype 1.6.0

 

isFunction:function(obj){
   return typeof obj == "function";
}
 

 

 

 

/*
*isFunction-judge the source is or not function*
*@function*
*@param source*
*@return {boolean}*
*/
ZYC.lang.isFunction = function(source){
    return Object.prototype.toString.call(source) === "[object Function]";
};