Javascript Array foreach( callback ) method

Description

Javascript Array foreach( callback ) method


Array.prototype.foreach = function( callback ) {
  for( var k=0; k<this .length; k++ ) {
    callback( k, this[ k ] );/*from   www  .j  a  v a2s  .  c o  m*/
  }
};



PreviousNext

Related