Javascript Array equals(element)

Description

Javascript Array equals(element)


Array.prototype.equals = function (element) {
 if (this === element) return true;
 if (element == null || this == null) return false;
 if (element.length != this.length) return false;
 for (var i = 0; i < element.length; ++i) {
  if (element[i] !== this[i]) return false;
 }
 return true;//from   ww w  .j  a v a  2  s .co m
}



PreviousNext

Related