Question:medium

What is the role of the return keyword inside a JavaScript function ? Explain with an example.

Show Hint

The return statement can also be used without a specified value (e.g., return;) to act as an early exit safeguard inside control loops or conditional blocks: if (input === null) return;
Updated On: Jun 29, 2026
Show Solution

Solution and Explanation

Was this answer helpful?
0