How do I make a function with delay in time using JavaScript?
Gabriel F.
answered 10/07/19
Full stack Javascript Engineer
const doSomething = () => {
const timeInMilliSeconds = 3000;
window.setTimeout(() => doSomething(), timeInMilliSeconds);
window.setInterval(() => doSomething(), timeInMilliSeconds);
Still looking for help? Get the right answer, fast.
OR
Find an Online Tutor Now
Choose an expert and meet online.
No packages or subscriptions, pay only for the time you need.