次のように、clearTimeout の引数である timeoutId の宣言を関数 playSlideshow() の中でしたらうまく機能しませんでした。どこがいけないのでしょうか?
ちなみに、const ではなく let で宣言してもダメでした。
// let timeoutId;
function playSlideshow() {
const timeoutId = setTimeout(() => {
next.click();
playSlideshow();
}, 1000);
}
この回答を見るにはプレミアムプランへの登録が必要です
プレミアムプランとは?