My original code but the letter 'i' received a message as undefined.
original code.
function buttonRed {
for (let i=0; i < all_buttons.length; i++) {
all_buttons[i].classList.remove(all_buttons[i].classList[1];
all_buttons[i].classList.add(all_buttons[i].classList[1];
all_buttons[i].classList.add('btn-danger');
}
console.log stated "i" was not defined. I then changed "let" to "var" in the line of code and now console.log says cannot read property of classList of undefined.