java get first few elements of string array code example
Example 1: return last two values of array in javascript
arr.slice(Math.max(arr.length - 5, 1))
Example 2: javascript get first element of array
alert($(ary).first());
arr.slice(Math.max(arr.length - 5, 1))
alert($(ary).first());