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
Types · easy
15. Type Assertions
Overriding the compiler's inference.
Assume `input` is `any`. Assert it as `string` to call `.length`.
Required in your answer:
as string
Reveal solution
Run & check
Reset
Transpiled, then run in a sandbox
function getLength(input: any) { // TODO }
Output appears here.
← 14. The never Type
16. Non-null Assertion →