I have something like this…
$( 'ul li' ).each( function( index ) {
$( this ).append( ',' );
} );
I need to know what index will be for last element, so I can do like this…
if ( index !== lastIndex ) {
$( this ).append( ',' );
} else {
$( this ).append( ';' );
}
Any ideas, guys?
1 Answer