jquery iterate obj

JavaScript
$( "li" ).each(function( index ) {
  console.log( index + ": " + $( this ).text() );
});
$( "li" ).each( function( index, element ){
    console.log( $( this ).text() );
});
 
// Logs the following:
// Link 1
// Link 2
// Link 3

Source

Also in JavaScript: