JavaScript возьмите первый элемент массива
const array = [1,2,3,4,5];
const firstElement = array.shift();
// array -> [2,3,4,5]
// firstElement -> 1
Nice Nightingale
const array = [1,2,3,4,5];
const firstElement = array.shift();
// array -> [2,3,4,5]
// firstElement -> 1
let array = ["a", "b", "c", "d", "e"];
// Both first1 and first2 have the same value.
let [first1] = array;
let first2 = array[0];