var Type = {}; for(var i = 0 ,type;type = ['String','Array','Number'][i++];){ (function(type){ Type['is'+type] = function(obj){ return Object.prototype.toString.call(obj) === '[object ' + type +']'; } })(type); }
明白这个是怎么循环出来的吗?
相关分类