Ravi Sir's Cards › AWS
return vs exit
This comparison card contrasts return and exit. return is described as leaves the function. exit is described as ends the whole script. The card pairs return with helper failed, and exit with fatal error.
Read card text
What this card says
Stop
return
Leaves the function.
exit
Ends the whole script.
Key points
Caller keeps running.
Nothing after it runs.
Example
return 1
Use when
Helper failed.
Fatal error.