-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.js
More file actions
92 lines (66 loc) · 1.85 KB
/
function.js
File metadata and controls
92 lines (66 loc) · 1.85 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// console.log("m");
// console.log("o");
// console.log("h");
// console.log("s");
// console.log("i");
// console.log("n");
function sayMyName() {
console.log("m");
console.log("o");
console.log("h");
console.log("s");
console.log("i");
console.log("n");
}
sayMyName // refrance of function
// sayMyName(); // excutions
// function addTwoNumbers(number1,number2){ // number1 and number2 are para
// console.log( number1+number2);
// }
// function addTwoNumbers(number1,number2){ // number1 and number2 are para
// let result = number1+number2;
// console.log(result);
// return result;
// }
// function addTwoNumbers(number1,number2){ // number1 and number2 are para
// return number1+number2;
// }
// addTwoNumbers(3,7);// 3 and 7 is arguments
function loginUserMessage(username){
// if (username === undefined) {
// console.log("Please Enter a username");
// return;
// } // other type
if (!username) {
console.log("Please Enter a username");
return;
}
return `${username} just Logged In`
}
// console.log(loginUserMessage("devil")) // devil
// console.log(loginUserMessage("")) // just Logged In
// console.log(loginUserMessage()) // undefined just Logged In
// 🏳️
// function calculateCartPrice(...num1){ // restOprator ...num1
// return num1
// }
// console.log(calculateCartPrice(2,6,7,800));
// 🏳️
// const user = {
// username:"mohsin",
// price:199
// }
// function handleObject(anyObject){
// console.log(`UserName is ${anyObject.username} and Price is ${anyObject.price}`);
// }
// // handleObject(user);
// // handleObject({
// // username:"devil",
// // price:399
// // })
// handleObject(user)
const myNewArray=[20,30,40,50,60,70];
function ArrayData(getValue){
return getValue[3];
}
console.log(ArrayData(myNewArray));