0 votes
in JavaScript by
What is the primary role of the "return ()" statement in a function body?

a) It returns the value and continues executing rest of the statements

b) It returns the value and stops the program execution

c) Stops executing the function and returns the value

d) It returns the value and stops executing the function

1 Answer

0 votes
by

Answer: D

Reason: In general, the "return" statement is the last statement in the body of function if the function is return-type. Whenever the return statement gets encountered in the definition of the function, the execution of the function will stop, and it returns the stored value to the statement where the function call has been made.

Related questions

0 votes
asked Mar 24, 2021 in JavaScript by sharadyadav1986
0 votes
asked Oct 8, 2022 in JavaScript by rajeshsharma
...