diff settimeout and setinterval code example
Example: setinterval vs settimeout
setTimeout allows us to run a function once after the interval of time.
setInterval allows us to run a function repeatedly, starting after the interval of time, then repeating continuously at that interval.