Returns true if object is an Arguments object

返回true,如果是arguments对象

1 (function(){ return _.isArguments(arguments); })(1, 2, 3);
2 => true
3 _.isArguments([1,2,3]);
4 => false

源码:

1   _.isArguments = function(obj) {
2     return toString.call(obj) == '[object Arguments]';
3   };
4   if (!_.isArguments(arguments)) {
5     _.isArguments = function(obj) {
6       return !!(obj && _.has(obj, 'callee'));
7     };
8   }

 

 

 

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