Hi, Lydia Hallie can you tell me what is the case with setInterval in call stack a combination of setTimeout and setInterval see the usecase below. Is setInterval also supposed to go to webAPI?
let c = 0;
let id = setInterval(()=> {
console.log(c++)
},200)
setTimeout(()=> {
clearInterval(id)
},2000)
// prints
/* 0
1
2
3
4
5
6
7
8
9
and then stops */
Hi, Lydia Hallie can you tell me what is the case with setInterval in call stack a combination of setTimeout and setInterval see the usecase below. Is setInterval also supposed to go to webAPI?
2000/200 = 10 times
after 2 seconds we clear setInterval id