Skip to content

Commit b974aff

Browse files
authored
update arrow function
1 parent 6ad84b8 commit b974aff

File tree

5 files changed

+46
-26
lines changed

5 files changed

+46
-26
lines changed

Example/Function/Arrow functions/Arrow.js

Whitespace-only changes.

Example/Function/Arrow functions/index.html

Whitespace-only changes.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
function info(){
3+
console.log("welcome to codeswithpankaj.com");
4+
}
5+
6+
// calling function
7+
8+
info();
9+
10+
// Function With Parameters
11+
12+
function UserInfo(Name,age,height){
13+
console.log(`My Name is ${Name} and I am ${age} years old and my Height ${height}`);
14+
}
15+
16+
// calling function
17+
18+
UserInfo("Nishant",12,4.5);
19+
20+
// return type
21+
22+
function set_tax(){
23+
return 250;
24+
}
25+
26+
values = set_tax()
27+
console.log(` this is tax ${values} `);
28+
29+
// Function with Default Parameters
30+
31+
function greet(name = "Guest") {
32+
console.log("Hello, " + name + "!");
33+
}
34+
35+
greet("Nishant"); // Outputs: Hello, Nishant!
36+
greet(); // Outputs: Hello, Guest!
37+
38+
// Function Expressions
39+
40+
multiply = function(a, b) {
41+
return a * b;
42+
};
43+
44+
result = multiply(4, 3);
45+
console.log("The result is: " + result);
46+
File renamed without changes.

Example/Function/function.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)