摘要:
说组Array扩展是否包含元素属性://扩展函数(是否包含某元素)Array.prototype.contains=function(e){for(i=0;i<this.length;i++){if(this[i]==e)returntrue;}returnfalse;}/*用法:var temp = [1,2,3,4,5];var status = temp.contains(1);*/日期格式化:Date.prototype.formate = function(fmt){varo={"M+":this.getMonth()+1,//月份"d+" 阅读全文