Creating Custom Events

How can you ensure a custom event handler runs only once?
element.addEventListener('customAction', function handler(e) {
  console.log('Action handled:', e.detail);
  element.removeEventListener('customAction', handler);
}, { once: true });
Next Question (7/20)