Functions
Defining functions with function, parameters, returning values with return, and default parameters.
Simple enough for a 5-year-old to understand
function and return
function square(x) { return x * x;}console.log(square(5));🎯 Exercise & Practice
Test what you've learned — answer, write code, check instantly. (1 left)
🎯 Expected output: 17