摘要:
Array.prototype.removeIndex = function(i) { if (isNaN(i) || i > this.length) return false; this.splice(i,1); } Array.prototype.remove = function(key) { for (var i = 0; i < this.length; ++i)... 阅读全文
摘要:
如果两个对象属性在初始化时出现的顺序不一样 但数目及值一样,最终比较结果也是true支持每个属性又是其他类型,如对象、数组、数字、字符串 function equal(objA, objB){ if (typeof arguments[0] != typeof arguments[1]) return false; //数组 if (arguments[0] instanceof Array) ... 阅读全文