Is there a way to move an element rendered in html that is stored inside of an array?
My code generates a new div every time a function is called, that div has an animation class added to it, to make it fall down the screen. Then I need to randomly move its X position by a number of pixels.
let num = Math.floor(Math.random() * 5);
array.forEach((item) => {
item.style.left = `${num}px`;
});