var output=Input[0]
It prints the first element in case you want to filter under certain restrictions
var Input = [ a, b, c, d, e, a, c, b, e ]; $( "div" ).text( Input.join( ", " ) ); Input = jQuery.grep(Input, function( n, i ) { return ( n !== c ); });
source share