forked from Swap76/Learn-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.js
More file actions
30 lines (24 loc) · 915 Bytes
/
Copy pathfunctions.js
File metadata and controls
30 lines (24 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function helpGST () { // This way you can write functions in JS
// There is no requirement of specifying the return type of function
console.log("Hii GST");
}
// Function is written to do a specific task many types in program.
// This increases the maintainability and decreases the repetition of same code.
helpGST(); // For executing we have to call that function
function Add (a,b) { // Here We have taken 2 Arguments a and b
let c = a + b;
return c; // This returns the result
}
console.log(Add(10,5)); // This Calls the function
// We have to directly pass the arguments in function call
// Functions which don't have name are called Anonymous this should be assigned to a particular variable
let helpFast = function (){
return("Fast Fast");
}
console.log(helpFast());
// Output Fast Fast
let helpVeryFast = () => {
return("Very Fast");
}
console.log(helpVeryFast());
// Output Very Fast