подскажите, почему в первом варианте с forEach ошибки нет в text.classList.add('show'); ?
let texts = document.querySelectorAll(...)
texts.forEach(text => {
...
setTimeout(function () {
console.log(text);
text.classList.add('show');
}, 500);
})
а здесь ошибка в txt.classList.add('show');
let txt;
for(let i in texts){
txt = texts[i];
...
setTimeout(function () {
console.log(txt);
txt.classList.add('show');
}, 500);
}
txt = ƒ entries() { [native code] }