Javascript Tutorial | How to end setInterval

preview_player
Показать описание
Please Like and Subscribe for more quality content.

In this video, I am going to show you how to stop setInterval by using clearInterval.

***

The code is as follows:

var myVar = setInterval(timer, 1000);

function timer() {
var d = new Date();

if (t === "21:11:20") {
clearInterval(myVar);
}
}
Рекомендации по теме