Javascript Array isEqualTo(a2)

Description

Javascript Array isEqualTo(a2)



/**/* w ww. jav a2  s  .  c  o m*/
 * Test if an array is equal to another one
 */
Array.prototype.isEqualTo = function (a2) {
  return (this.length === a2.length) && this.every( function( el, i) {
        return el === a2[i]; });
};



PreviousNext

Related