How do you get the first element from an array like this:
var ary = ['first', 'second', 'third', 'fourth', 'fifth'];
I tried this:
alert($(ary).first());
But it would return [object Object]
. So I need to get the first element from the array which should be the element 'first'
.
33 Answers
like this
alert(ary[0])