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
Functions · medium
21. Closures
Functions that remember.
Write `makeCounter()` returning a function that returns 1, 2, 3… on each call.
Required in your answer:
return
Reveal solution
Run & check
Reset
Runs in a sandboxed worker
function makeCounter() { // TODO }
Output appears here.
← 20. JSON
22. Objects with methods →