Overview - Return values
What is it?
Return values are the results that a function sends back after it finishes running. When you call a function, it can do some work and then give you back a value to use later. This lets you reuse code and get answers from functions instead of just making them do things silently.
Why it matters
Without return values, functions would only perform actions without giving any feedback or results. This would make programs less flexible and harder to build because you couldn't get information out of functions to use elsewhere. Return values let you build programs that solve problems step-by-step and share results between parts.
Where it fits
Before learning return values, you should understand what functions are and how to define and call them. After mastering return values, you can learn about multiple return values, how to handle them, and advanced topics like generators or async functions that also produce results.