Home » JavaScript » JavaScript Functions » Question
  1. What is the purpose of a return statement in a function?
    1. Stops executing the function and returns the value
    2. Returns the value and stops executing the function
    3. Returns the value and stops the program
    4. Returns the value and continues executing rest of the statements, if any
    5. None of these
Correct Option: A

The return stops the execution of the function when it is encountered within the function.It returns the value to the statement where the function is called.



Your comments will be displayed only after manual approval.