Yashotantra Academy
AI · Blockchain · Cloud · Data
Dark mode active
Learn
Tracks
ABCD
Certification
More
▾
Dark mode active
Learn
Tracks
ABCD
Certification
Study
Theory
Code Lab
Build
Solidity IDE
Staking Sandbox
Simulation
Reference
Wallets
Gas Fees
Explorers
← Code Lab
JavaScript
0/50 solved · 0%
All lessons
lesson
code
Patterns · hard
43. Event emitter
Pub/sub in 20 lines.
Write `class Emitter` with `on(event, fn)` and `emit(event, payload)`.
Required in your answer:
class Emitter
emit
Reveal solution
Run & check
Reset
Runs in a sandboxed worker
class Emitter { // TODO }
Output appears here.
← 42. Deep clone & equality
44. Async queue →