Page 166 - CITS - CSA - TP (Volume 1) - Hindi
P. 166
कंप्यूटर सॉफ्टवेयर एप्लीकेशन- CITS
III रटन ेटम ट वाला फं न (Function with return statement)
1 टे एिडटर ओपन कर
2 िन िल खत कोड िलख
<html >
<head>
<title> Function with return statement </title>
</head>
<body>
<script>
// JavaScript function with a return statement
function multiply(num1, num2) {
return num1 * num2;
}
// Example of using the function
var result = multiply(5, 3);
console.log(“Result of multiplication: “ + result);
</script> </script>
</body>
</html>
3 ो ाम को .html फ़ाइल के प म सेव कर
4 वेब ाउज़र से html फ़ाइल ओपन कर
5 ाउज़र कं सोल टैब पर जाएँ और आउटपुट की पुि कर ।
टा 2: एनोिनमस फ़ं न बनाना
I फ़ं न ए ेशन का उपयोग करना (Using Function Expression)
1 टे एिडटर ओपन कर
2 िन िल खत कोड िलख
<html >
<head>
<title> </title>
</head>
<body>
150
CITS : IT & ITES - कं ूटर सॉ वेयर ए ीके शन - अ ास 41

