+ 2
What does a return statement?
I have a hard time understanding what the return statement is for and why do we use it. I would really appreciate if someone explained it to me as if I were a very dumb 5 year old. Thank you!
3 Answers
+ 2
think of it as performing a calculation with your calculator and asking for a result
+ 1
ghali lawal so the return gives the result to the calculation? Do we only use the statement if we're calculating something?
0
Think about it as giving an input to your function, doing something with that input value and then spitting it out as new value with return statement.