The return feature is available in almost every programming language. Developers can use the return keyword with or without a value. If a value is specified, it will be returned to the caller. Otherwise, a null value will be returned. The return statement ends the function execution and specifies a value to be returned to the function caller. When a return statement is used in a function body, the execution of the function is stopped. If specified, a given value is returned to the function caller. The return statement is affected by automatic semicolon insertion (ASI). ;
- this means that the return statement is allowed for no line terminator between the return statement and the expression.
Also, when discussing the return statement it is used for interrupting loops or functions to end the loop. This return statement is used to interrupt the loop and end the execution in the middle
Leave a Reply
You must be logged in to post a comment.