Function Call Result
Predict Output Easy
Question
What does this code print?
Code
function add(a, b) {
return a + b;
}
console.log(add(3, 4));
Hint
The function returns the sum of its two parameters.
Explanation
add(3, 4) calls the function with a=3 and b=4. The return statement returns 3+4=7. console.log prints 7. The output is: 7
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.