In the code below, if I leave out the setTimeout, the transition doesn't work. What is the purpose of the setTimeout here?
function showCircle (top, left, radius) {
let circleDiv = document.querySelector(".circle");
circleDiv.style.top = top + "px";
circleDiv.style.left = left + "px";
setTimeout (() => {
circleDiv.style.width = radius*2 + "px";
circleDiv.style.height = radius*2 + "px";
},0)
}
showCircle (150,150,100);