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
TypeScript
0/50 solved · 0%
All lessons
lesson
code
Foundations · easy
3. Tuples
Fixed-length arrays with specific types.
Define a `Point` as a tuple of two numbers (x, y). Write `distance(p)` that returns the distance from origin.
Required in your answer:
[number, number]
Reveal solution
Run & check
Reset
Transpiled, then run in a sandbox
function distance(p) { // TODO }
Output appears here.
← 2. Array Types
4. Function Types →