I'm experiencing an interesting bug where elt is undefined for some calls to switchToReady. It seems like the function inside setTimeout is passing the same DOM node twice.
function switchToReady(elt) {
elt.setAttribute('transform', 'translate(17, 0)');
elt.classList.remove('compiling');
}
const compilingElts = document.getElementsByClassName('compiling');
for (let i = 0; i < compilingElts.length; i++) {
const randTime = Math.round(Math.random() * (2000 - 500)) + 500;
setTimeout(() => {
switchToReady(compilingElts[i]);
}, randTime);
}