Код: Выделить всё
let channels_history = [0, 0, 1, 0];
let channel = 0;
// wrapped in some button click event handler >>>>>
channel = channels_history.pop();
console.log(channels_history);
\\
Подробнее здесь: [url]https://stackoverflow.com/questions/79353413/array-pop-only-works-when-not-assigning-to-variable[/url]