how to get the first element from a array in javascript code example Example: javascript get first element of array console.log(ary[0]);