Skip to content

Commit 198a569

Browse files
committed
hello
1 parent 9498bc9 commit 198a569

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

Function/BasicFunctionInJS.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//asic Function Declaration
2+
function aman() {
3+
console.log("Hello mere bhai")
4+
}
5+
aman()
6+
function anup(){
7+
console.log("Hello Kya kr rahe hoo")
8+
}
9+
anup();
10+
//Function with Parameters
11+
//Parameters let you pass values into a function.
12+
function greet(name) {
13+
console.log("Hello " + name);
14+
}
15+
16+
greet("Anup");
17+
greet("Rahul");
18+
19+
function greet(name) {
20+
console.log("Hello " + name);
21+
}
22+
greet('Anup');
23+
greet("Abhishek");
24+
25+
26+
function abhishek(name) {
27+
console.log("Hello " + name);
28+
}
29+
30+
abhishek("Kya kr rha hai");
31+
abhishek("kya kr rahe ho tum"); //Call the function OutSide

Function/JSFun.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,25 @@ function loginUserMessage(username = "sam"){
8989
return `${username} just logged in`
9090
}
9191

92-
console.log(loginUserMessage("Anup"))
92+
console.log(loginUserMessage("Anup"))
93+
94+
function loginUserMessage(username = "anup"){
95+
if(username){
96+
console.log("Please enter a username");
97+
return
98+
}
99+
return '${username} just logged in'
100+
}
101+
102+
103+
function greet() { //Basic Function Declaration
104+
console.log("Hello JavaScript!");
105+
}
106+
107+
greet(); // calling the function
108+
109+
110+
function aman() {
111+
console.log("Hello mere Bhai");
112+
}
113+
aman();

0 commit comments

Comments
 (0)