javascript beginner ينتهي في 2026-11-17

Build a tiny event emitter

Write a class Emitter with:

  • on(event, handler): subscribe; returns a function that unsubscribes.
  • once(event, handler): subscribe for one call only.
  • emit(event, ...args): call every handler for event in the order they subscribed.

حلّه 0 شخصًا حتى الآن.

javascript
المحررCtrl + Enter

            
        

عندما تطبع الاختبارات "All tests passed" يُعلَّم التحدي كمحلول في هذا المتصفح.

إرسال حلك للمراجعة