Массив без последнего элемента

const initial = arr => arr.slice(0, -1);
initial([1, 2, 3]); // [1, 2]
Массивы и объекты JavaScript JavaScript