Understanding Functions
Concept CheckBeginner
Question
Which statement best describes what a function is in programming?
Hint
Functions are about packaging code so you can reuse it.
Explanation
A function is a named, reusable block of code that does a specific job. You call it by name to run the code inside, optionally passing inputs (parameters) and getting a result back (return value). The other options describe variables, loops, or import statements — not functions.
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.