class StatsDisplay extends HTMLElement { static get observedAttributes() { return ['money', 'population', 'nickname']; } connectedCallback() { this.render(); } attributeChangedCallback() { this.render(); } render() { const money = this.getAttribute('money') || '0'; const population = this.getAttribute('population') || '0'; const nickname = this.getAttribute('nickname') || 'Player'; const formattedMoney = parseInt(money).toLocaleString(); this.innerHTML = `