Timeout vs setInterval in react code example
Example: difference between setTimeout() and setInterval()
.setTimeout() //executes the code after x seconds.
.setInterval() //executes the code **every** x seconds.
.setTimeout() //executes the code after x seconds.
.setInterval() //executes the code **every** x seconds.