the functions execution is done and wont ever be called again but still I can access the event handler inside it
(function () {
const header = document.querySelector('h1');
header.style.color = 'red';
header.addEventListener('click', function () {
this.style.color = this.style.color === 'blue' ? 'red' : 'blue';
});
})();