varType={};//type=["String","Array","Number"][i++]这不成了一个复合数组了吗??不太理解for(vari=0,type;type=["String","Array","Number"][i++];){(function(type){Type["is"+type]=function(obj){returnObject.prototype.toString.call(obj)==='[object]'+type+']';}})(type);}alert(Type.isArray([]));alert(Type.isString("str"));
跃然一笑
繁星coding
相关分类