Can someone quickly and simply explain to me how to perform an action every couple of seconds using
var timeOut = setTimeout(FunctionName, 5000);
As you asked for a method using setTimeout:
setTimeout
function doStuff() { console.log("hello!"); setTimeout(doStuff, 5000); } setTimeout(doStuff, 5000);
But it would probably be better to use setInterval:
setInterval
function doStuff() { console.log("hello!"); } setInterval(doStuff, 5000);