JavaScript animations come in handy when you find it difficult to create your animations with CSS Transitions or CSS Animations. They are very useful and very easy to configure.
The ideal way to animate elements with pure JavaScript is to use through the Web Animations API.
Unfortunately, the Web Animations API is not well supported yet.
If you want to create animations with JavaScript, the easiest way is to use animation libraries.
Animations libraries
There are many libraries you can use. Examples are:
GreenSock Animation API
jQuery.animate
Velocity.js
Of the three (and many others not listed here), I highly recommend to use GreenSock Animation API. You’ll learn how to use it in the next lesson.