Resolved: Return outcome
Hi sir you mentioned a function can have single return yet here you used two returns ?
1 answers ( 1 marked as helpful)
Hi Abdishakuur!
Thanks for reaching out.
A function may contain multiple
Hope this helps.
Best,
Tsvetelin
Thanks for reaching out.
A function may contain multiple
return statements, but only the first one that is reached will execute. In this example, return "Outcome" ends the function immediately, so return result is never reached and is effectively ignored.Hope this helps.
Best,
Tsvetelin