skip to Main Content

setInterval and clearInterval in javaScript

let count = 0; function printCount() { console.log("Count:", count); count++; if (count > 5) { clearInterval(intervalId); } } let intervalId = setInterval(printCount, 1000); clearInterval(intervalId); I do not understand why its not working on Google Chrome console. Can you help me…

VIEW QUESTION

Html – SetInterval withing a Promise

const navTimeout = new Promise((resolve, reject) => { setInterval(async () => { try { await workbook.xlsx.readFile("variables.xlsx") const sheet = workbook.getWorksheet(1) if(sheet.getCell('B13').value === "D") return resolve(true) } catch (error) { console.log("Workbook being used") } }, 5000) }) I have the following…

VIEW QUESTION
Back To Top
Search