How to Make an Animation - setInterval vs. requestAnimationFrame
Fullstack Academy
0:00 / 0:00
How to Make an Animation - setInterval vs. requestAnimationFrame
4 619 просмотров · 10 л. назад
Fullstack Academy
58,2 тыс. подписчиков
4 619 просмотров · 10 л. назад
Learn more advanced front-end and full-stack development at: https://www.fullstackacademy.com
setInterval() and requestAnimationFrame() are methods for running animations in the browser. setInterval() calls functions or evaluates expressions at specified intervals. requestAnimationFrame() allows developers to render new changes to the DOM based on the function it is invoked with. This tutorial will go over the primary differences between setInterval and requestAnimationFrame and will show you how to make an animation with each one.
Watch this video to learn:
When to use setInterval or requestAnimationFrame
How to create custom setInterval and setTimeout functions using requestAnimationFrame
The pros and cons involved in the process