これは私が使用している単純なsetIntervalの例ですが、clearIntervalはsetIntervalを停止していません。渡された0から負の数までカウントします。これを機能させて0で停止するにはどうすればよいですか?
getMoreVideosCountdown = 10;
getMoreVideos = setInterval(function() {
console.log(getMoreVideosCountdown);
if (getMoreVideos <= 0) {
clearInterval(getMoreVideos);
}
getMoreVideosCountdown--;
},1000);