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
Strings · easy
15. String methods
slice, toUpperCase, startsWith.
Write `shorten(addr)` returning the first 6 and last 4 characters joined by `…` (e.g. `0x1234…cdef`).
Required in your answer:
.slice(
Reveal solution
Run & check
Reset
Runs in a sandboxed worker
function shorten(addr) { // TODO }
Output appears here.
← 14. find & includes
16. Numbers & rounding →