javascript how to get 1st array code example Example 1: javascript get first element of array console.log(ary[0]); Example 2: javascript get first element of array alert(ary[0])