JSFiddle - React, Tailwind, and code Playground
HTML
<button onclick="testList.push(new Test());">run</button>
JavaScript
testList = [];
Test = function(){
this.y = 25;
that = this;
this.interval = setInterval(function(){
that.y += that.dy;
if (that.y>300){
console.log(that.y);
clearInterval(that.interval);
}
}, 10);
}