Predict Function Call Output
Predict Output Easy
Question
What does this code print?
Code
function multiply(a, b) {
return a * b;
}
console.log(multiply(4, 5));
Hint
Substitute the arguments into the function body.
Explanation
multiply(4, 5) assigns a=4 and b=5, then returns a * b = 4 * 5 = 20. console.log prints the returned value: 20
Related Resources
Related Lessons
- Functions
Learn how functions work in programming.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.