Skip to content

Commit 6ad84b8

Browse files
authored
update Function example
1 parent b10f8f4 commit 6ad84b8

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

Example/Function/function.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
console.log(` this is tax {set_tax()}`);

Example/Function/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
<script src="function.js"></script>
8+
</head>
9+
<body>
10+
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)