-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy path46.js
More file actions
40 lines (28 loc) · 774 Bytes
/
46.js
File metadata and controls
40 lines (28 loc) · 774 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
39
40
// arrow functions
// const singHappyBirthday = function(){
// console.log("happy birthday to you ......");
// }
const singHappyBirthday = () => {
console.log("happy birthday to you ......");
}
singHappyBirthday();
const sumThreeNumbers = (number1, number2, number3) => {
return number1 + number2 + number3;
}
const ans = sumThreeNumbers(2,3,4);
console.log(ans);
// const isEven = function(number){
// return number % 2 === 0;
// }
const isEven = number => number % 2 === 0;
console.log(isEven(4));
const firstChar = anyString => anyString[0];
console.log(firstChar("harshit"));
const findTarget = (array, target) => {
for(let i = 0; i<array.length; i++){
if(array[i]===target){
return i;
}
}
return -1;
}