We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 126587f commit 75a1ceaCopy full SHA for 75a1cea
part5 (Functions)/AdvanceFunctions/08_return.keyword.js
@@ -0,0 +1,18 @@
1
+/*
2
+INFO: What is the return statement ?
3
+The return statement is used to output a value from a function and terminate its execution.
4
+*/
5
+
6
+// Syntax
7
+function add(a, b) {
8
+ return a + b;
9
+}
10
+let ans = add(2, 2);
11
+console.log(ans);
12
13
+// Example
14
+function greet() {
15
+ return "Hello!";
16
17
+let message = greet();
18
+console.log(message);
0 commit comments