JavaScript में फंक्शन और पैरामीटर

Posted by

जावास्क्रिप्ट में फंक्शन और पैरामीटर

जावास्क्रिप्ट में फंक्शन और पैरामीटर

जावास्क्रिप्ट में फंक्शन एक ब्लॉक कोड होता है जिसे एक बार डिफ़ाइंड किया जाता है और कभी भी कॉल किया जा सकता है। फंक्शन में एक या एक से अधिक पैरामीटर पास किए जा सकते हैं जिन्हें फंक्शन के बॉडी में उपयोग किया जा सकता ह।

एक बुनियादी उदाहरण के रूप में, एक फंक्शन बनाते हैं जो दो संख्याओं को जोड़ता है।


function addNumbers(num1, num2) {
    return num1 + num2;
}

var result = addNumbers(5, 10);
console.log(result); // Output: 15

यहां, addNumbers नामक फंक्शन के लिए दो पैरामीटर num1 और num2 पास किए गए हैं। जोड़ने के काम करने के लिए इन पैरामीटरों का उपयोग किया गया है और इसका परिणाम 15 है।

जब भी फंक्शन को कॉल किया जाता है, पैरामीटर पास किए गए मान उस फंक्शन के बॉडी में उपयोग किए जाते हैं और एक वापसी मान उत्पन्न करते हैं।

0 0 votes
Article Rating
27 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@user-uf8em7xl7c
3 months ago

thank you so much sir ❤❤❤

@mdtauseefparvez4412
3 months ago

Sir ji bohot achi and in depth series banai hai apne ………….Thankyou very very much sir ji.

@bijjubahuguna6114
3 months ago

sir maja aara hai bahut pdhne m

@AMEYMHATRE-xc2kr
3 months ago

great sir

@MohdUvaisKhan-lu5bl
3 months ago

Why this channel is so under rated

@shortsviral359
3 months ago

Bhai mujhe functions to bhut acche se aate hai.
Aapne itne complex krke kyu padhaya itna aasan to the

@achalambere3129
3 months ago

just love it sir !!!!🤩🤩

@Hmm0821
3 months ago

thank you so much for detailing video. keep making such detailed video with more detailed. like why we need? what is real use case of this concept etc.❤❤

@roshangupta1686
3 months ago

thank you sir

@adimalik7642
3 months ago

Yes sir we are enjoying the way you teach <3

@pritomdas144
3 months ago

i think this is the best js series in youtube….love from bangladdesh SIR

@sureshbagada7897
3 months ago

Hello sir,
I want to learn JavaScript and TypeScript, so which series from your course I need to start…. please guide me to learn better…….

@balaramc3808
3 months ago

Awesome teaching, and watching this video makes me feel better than ever in my coding. Thanks a lot, sir, 👍 🙏 🙏

@n___series1173
3 months ago

good teaching method

@anuraggupta1008
3 months ago

functions in javascript in depth

@himanshubhardwajmalira6199
3 months ago

i am watching this series for the third time, osm series thank you sir 🥰🥰🥰 easy to understand the complex topics

@ankitamaru9712
3 months ago

Amazing sir going on teaching thank you. Please more videos for javascript .Thank you

@GameToLearnYT
3 months ago

its my opinion, JavaScript ka ye series bhut accha hai.. kahi jane ka nhi bs dekho aur sikho ❤❤❤❤❤❤❤❤❤❤❤❤❤❤ …100 star out of 10 ☺☺🤪🤪

@ajitrai9317
3 months ago

Thank you sir for this amazing js series..

@RahulSharma-wz6yv
3 months ago

Nice , the deep extraction of concepts are the thing which holds the most to viewers