Good morning, I'm trying to know how to access an attribute declared in a setInterval / setTimeOut function in another function. With the little bit of study I have on JavaScript, a variable declared in local scope can not be accessed in another local site (a function accessing attributes of another) unless it is this.variavel
because it makes it "public" and you instantiate a object of this variable in the other obj = new NomeDaFuncao()
function. Unfortunately I'm not sure how to instantiate an object from a setInterval / setTimeOut function. Below is an example of what I'm trying to do.
setInterval(() =>
{
this.btn = document.querySelector(".remove-button");
},0);
function FazAlgo()
{
btnRemove = new setInterval();
console.log(btnRemove.btn.value);
}