I would like to understand more about the nature of these three functions mentioned above. What is the main objective for each one? When it comes to animations, what is the best option for DOM changes?
I would like to understand more about the nature of these three functions mentioned above. What is the main objective for each one? When it comes to animations, what is the best option for DOM changes?
For what I've used
requestAnimationFrame It's more for games or animations, it's like a set interval only without problems with the difference of MS from one computer to another, came along with CSS3 and HTML5 link
SetInterval is the method to perform an ac action X milliseconds link
SetTimeout is the method that runs a method ONLY ONCE after X milliseconds link
Depending on the animation you should use css3