What does the 'return' keyword do?

Asked by blessing007 · 2 weeks ago

1 Answer

55
amorebise · 2 weeks ago Top Answer

return is how a function gives something back to you. Imagine sending a child to the market with money; the return is the bread they bring back.

Without return, a function does its work but doesn't share the result. If you want to use a calculation later, you must return it.

Log in to add a comment.