0

why does not it work // почему код не выводит 6000?

function myAlert() { alert("Hi"); } setInterval(myAlert, 3000); clearInterval(myAlert, 6000);

30th Jul 2018, 7:16 PM
MakarovDs
3 Antworten
+ 3
function myAlert(){ alert("Hi"); } var i = setInterval(myAlert, 3000); setTimeout(function(){ clearInterval(i) },6000);
30th Jul 2018, 8:40 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 3
because you have to assign setInterval to a variable then clear it I think
30th Jul 2018, 8:44 PM
Mert Yazıcı
Mert Yazıcı - avatar
0
Mert Yazıcı why does not it work like I did?
30th Jul 2018, 8:43 PM
MakarovDs