-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path46.js
45 lines (33 loc) · 796 Bytes
/
46.js
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
// 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("prabhat"));
const findTarget = (array, target) =>
{
for (let i = 0; i < array.length; i++)
{
if (array[i] === target)
{
return i;
}
}
return -1;
}