🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

JavaScript में return statement का मुख्य उद्देश्य क्या है?

What is the main purpose of the return statement in JavaScript?

A
To call another function
B
To end the loop
C
To stop function execution and send a value back
D
To print output to console
Explanation

JavaScript में return स्टेटमेंट का उपयोग किसी function को रोकने और उसका result वापस भेजने के लिए किया जाता है।

उदाहरण (Example):

javascript
 
function add(a, b) { return a + b; } let result = add(2, 3); // result = 5

In English:
The return statement stops function execution and returns a value to where the function was called.

Correct Answer: C) To stop function execution and send a value back

Latest Updates