===== ISTEM =====
Solve the following programming task.

TASK: Event Emitter

Write an 'EventEmitter' class with 'subscribe(eventName, callback)' and 'emit(eventName, args)' methods. The 'subscribe' method must return { unsubscribe: () => void }.

STARTER CODE (javascript):
class EventEmitter {
  // Write your code here
}

module.exports = { EventEmitter };


RULES:
- Keep the function name and signature EXACTLY as given.
- Return working code only. No explanations.
- Put the code in a single ``` block.
- Try to solve it first. If you genuinely cannot, write only this single
  line instead of producing faulty code: CANNOT_SOLVE

===== HAM YANIT =====
```javascript
class EventEmitter {
  constructor() {
    this._events = new Map(); // eventName -> Set of callbacks
  }

  subscribe(eventName, callback) {
    if (!this._events.has(eventName)) {
      this._events.set(eventName, new Set());
    }
    const callbacks = this._events.get(eventName);
    callbacks.add(callback);

    return {
      unsubscribe: () => {
        callbacks.delete(callback);
        // Clean up if no callbacks left
        if (callbacks.size === 0) {
          this._events.delete(eventName);
        }
      },
    };
  }

  emit(eventName, args = []) {
    const callbacks = this._events.get(eventName);
    if (!callbacks) return;
    // Convert to array to allow modifications during iteration
    for (const cb of Array.from(callbacks)) {
      cb(...args);
    }
  }
}

module.exports = { EventEmitter };
```