const addElement = () => { const typeNum = Math.round(Math.random()); //returns 0 or 1; const newEle = document.createElement('div'); if(typeNum === 0) { configureWideElement(newEle); } else { configureTallElement(newEle); } newEle.style.left = coordinates.x + 'px'; newEle.style.top = coordinates.y + 'px'; header.appendChild(newEle); }