Exerpad
Exercise 3 · Chapter: FunctionsRequired+50 XP

Fix the Return

This function should return the square of a number, but it prints instead of returning. Fix it so the code below works!

Expected output:

25
Need a hint?
3 available · costs 5 XP each
javascript
function square(n) {
console.log(n * n);
}

let result = square(5);
console.log(result);
Output
Run your code to see the output here.