Ravindra BagaleCourses & study guides मराठी Track your progress

Ravi Sir's Cards › AWS

AWS Cloud

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.

return vs exit: Leaves the function.; Ends the whole script.
return vs exit · Download PNG
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.

See all AWS revision cards