first element of array js

JavaScript
const array = [1,2,3,4,5];
const firstElement = array.shift();

// array -> [2,3,4,5]
// firstElement -> 1arr[0]alert($(ary).first());
Source

Also in JavaScript: