You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Declare a function fullName and it print out your full name.
620
-
1. Declare a function fullName and now it takes firstName, lastName as a parameter and it returns your full - name.
621
-
1. Declare a function addNumbers and it takes two two parameters and it returns sum.
622
-
1. Declare a function name printArray. It takes array as a parameter and it prints out each value of thearray.
623
-
1. Declare a function name reverseArray. It takes array as a parameter and it returns the reverse of the arra- (dont’ use method).
624
-
1. Declare a function name capitalizeArray. It takes array as a parameter and it returns the - capitalizedarray.
625
-
1. Declare a function name removeItem. It returns array after removing an item
626
-
1. Declare a function name addItem. It returns array after adding an item
627
-
1. Declare a function name sumOfNumbers. It takes a number parameter and it adds all the numbers in that range.
628
-
1. Declare a function name sumOfOdds. It takes a number parameter and it adds all the odd numbers in that - range.
629
-
1. Declare a function name sumOfEven. It takes a number parameter and it adds all the even numbers in that - range.
619
+
1. Declare a function *fullName* and it print out your full name.
620
+
1. Declare a function *fullName* and now it takes firstName, lastName as a parameter and it returns your full - name.
621
+
1. Declare a function *addNumbers* and it takes two two parameters and it returns sum.
622
+
1. Declare a function name *printArray*. It takes array as a parameter and it prints out each value of thearray.
623
+
1. Declare a function name *reverseArray*. It takes array as a parameter and it returns the reverse of the arra- (dont’ use method).
624
+
1. Declare a function name *capitalizeArray*. It takes array as a parameter and it returns the - capitalizedarray.
625
+
1. Declare a function name *addItem*. It returns array after adding an item
626
+
1. Declare a function name *removeItem*. It returns array after removing an item
627
+
1. Declare a function name *sumOfNumbers*. It takes a number parameter and it adds all the numbers in that range.
628
+
1. Declare a function name *sumOfOdds*. It takes a number parameter and it adds all the odd numbers in that - range.
629
+
1. Declare a function name *sumOfEven*. It takes a number parameter and it adds all the even numbers in that - range.
630
630
1. Declare a function name . It takes a number parameter and it counts number of evens and odds in the - number.
631
631
output:
632
632
```she
633
633
evensAndOdds(100);
634
634
The number of odds are 50.
635
635
The number of evens are 51.
636
636
```
637
-
- Declare a function name randomHexaNumberGenerator. When this function is called it generates a random hexadecimal number. The function return the hexadecimal number.
637
+
- Declare a function name *randomHexaNumberGenerator*. When this function is called it generates a random hexadecimal number. The function return the hexadecimal number.
638
638
output:
639
639
```she
640
640
console.log(randomHexaNumberGenerator());
641
641
'#ee33df'
642
-
console.log(randomHexaNumberGenerator());
643
-
'#28def10'
644
-
console.log(randomHexaNumberGenerator());
645
-
'#38eeda'
646
642
```
647
-
- Declare a function name userIdGenerator. When this function is called it generates seven character id. The function return the id.
643
+
- Declare a function name *userIdGenerator*. When this function is called it generates seven character id. The function return the id.
648
644
Output:
649
645
```sh
650
646
console.log(userIdGenerator());
651
647
41XTDbE
652
648
```
653
-
- Modify question number n . Declare a function name userIdGeneratedByUser. It doesn’t take any parameter but it takes two inputs using prompt(). One of the input is the number of characters and the second input is the number of ids which are supposed to be generated.
649
+
- Modify question number n . Declare a function name *userIdGeneratedByUser*. It doesn’t take any parameter but it takes two inputs using prompt(). One of the input is the number of characters and the second input is the number of ids which are supposed to be generated.
654
650
```sh
655
651
userIdGeneratedByUser()
656
652
"kcsy2
@@ -660,26 +656,19 @@ ZXOYh
660
656
2Rgxf
661
657
"
662
658
userIdGeneratedByUser()
663
-
"3RexwUqvqe
664
-
rVUY6dC1il
665
-
YCf88ZHuAf
666
-
7JhI6Mn063
667
-
mo3GYyH26O
668
-
"
669
-
userIdGeneratedByUser()
670
659
"1GCSgPLMaBAVQZ26
671
660
YD7eFwNQKNs7qXaT
672
661
ycArC5yrRupyG00S
673
662
UbGxOFI7UXSWAyKN
674
663
dIV0SSUTgAdKwStr
675
664
"
676
665
```
677
-
- Write a function name rgbColorGenerator and it generates rgb colors.
666
+
- Write a function name *rgbColorGenerator* and it generates rgb colors.
678
667
Output:
679
668
```sh
680
669
rgb(125,244,255)
681
670
```
682
-
- Write a function name displayDateTime and it display in this format: 28/08/2018 04:08
671
+
- Write a function name *displayDateTime* and it display in this format: 28/08/2018 04:08
683
672
- Use the new Date() object to get month, date, year, hour and minute.
684
673
Output:
685
674
```sh
@@ -704,7 +693,7 @@ person.live = 'Finland';
704
693
705
694
```
706
695
#### Exercises:Objects
707
-
- Create an object literal called personAccount. It has firstName, lastName, incomes, expenses properties and it has totalIncomes, totalExpenses, acountInfo,addIncome, addExpence and accountBalance methods. Incomes is a set of incomes and its description and the same for expenses.
696
+
- Create an object literal called *personAccount*. It has *firstName, lastName, incomes, expenses* properties and it has *totalIncomes, totalExpenses, acountInfo,addIncome, addExpence* and *accountBalance* methods. Incomes is a set of incomes and its description and the same for expenses.
0 commit comments