ending_button.forEach(button => { if ( button.classList.contains('display')) { button.classList.remove('display'); } });

Cycle using the arrow function. Exemple on PureJS
Approved. Code works!
This is exactly the working code that is verified by the moderator or site administrators