// Correctly manage event listeners to prevent memory leaks
function setupListeners() {
const clickHandler = () => console.log('Clicked!');
document.addEventListener('click', clickHandler);
// Remove the event listener when it's no longer needed
setTimeout(() => document.removeEventListener('click', clickHandler), 10000);
}