Returns true if object is either true or false

返回true,如果对象是bool类型

1 _.isBoolean(null);
2 => false

源码:

1  _.isBoolean = function(obj) {
2     return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
3   };

 

 

 

posted on 2012-04-16 23:25  himanhimao  阅读(378)  评论(0编辑  收藏  举报