Typed Functions
Writing safe functions by specifying parameter and return types; void.
Simple enough for a 5-year-old to understand
Parameter and return type
function square(x: number): number { return x * x;}console.log(square(5));🎯 Exercise & Practice
Test what you've learned — answer, write code, check instantly. (1 left)
🎯 Expected output: 17