-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy path45.js
More file actions
38 lines (31 loc) · 786 Bytes
/
45.js
File metadata and controls
38 lines (31 loc) · 786 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
31
32
33
34
35
36
37
38
// function expression
// function singHappyBirthday(){
// console.log("happy birthday to you ......");
// }
const singHappyBirthday = function(){
console.log("happy birthday to you ......");
}
// singHappyBirthday();
const sumThreeNumbers = function(number1, number2, number3){
return number1 + number2 + number3;
}
const ans = sumThreeNumbers(2,3,4);
// console.log(ans);
// function isEven(number){
// return number % 2 === 0;
// }
const isEven = function(number){
return number % 2 === 0;
}
// console.log(isEven(2));
const firstChar = function(anyString){
return anyString[0];
}
const findTarget = function(array, target){
for(let i = 0; i<array.length; i++){
if(array[i]===target){
return i;
}
}
return -1;
}