take 1st element from an array javascript code example Example: javascript get first element of array alert($(ary).first());