JSFiddle - React, Tailwind, and code Playground
HTML
<div class="block"></div>
CSS
.block {
background: coral;
position: absolute;
height: 40px;
width: 40px;
}
JavaScript
var paths = [{ left: 300 }, { top: 161 }, { left: 402 }, {left: 50}, {left: 0, top: 100}];
$('.block').animate(paths.shift(), function next() {
$(this).animate(paths.shift(), paths.length && next);
});