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
Node.js
0/50 solved · 0%
All lessons
lesson
code
Patterns · easy
4. Basic Event Emitter
Simulate Node's EventEmitter.
Implement `on(event, cb)` and `emit(event, data)` using a Map.
Required in your answer:
new Map()
.forEach
Reveal solution
Run & check
Reset
Runs in a sandboxed worker
class Emitter { events = new Map(); // TODO }
Output appears here.
← 3. Basic Retry Logic
5. Merging Configs →