-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexitPrep.js
94 lines (64 loc) · 2.41 KB
/
exitPrep.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
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
91
92
93
94
// Your mission should you choose to accept it is to complete the following functions.
// If you choose to do so, you may find that you are ready to crush it on the precourse exit.
// Remember your training:
// Be sure you understand the instructions.
// Pseudocode your logic.
// Breathe.
// You can do this.
/////////////////////////////////////////////////////////
// MANIPULATING COLLECTIONS
/////////////////////////////////////////////////////////
const pureShuffle = array => {
// your code here
};
var isPalindrome = (string) => {
// your code here
}
const mergeObjects = obj => {
// your code here
};
//////////////////////////////////////////////////////
// USING RECURSION
//////////////////////////////////////////////////////
var replaceValuesInObj = (obj, value, newValue) => {
// your code here
};
var addKeysToExistingObj = (obj, newKey, newValue) => {
// your code here
};
var map = (arr, func) => {
// your code here
}
/////////////////////////////////////////////////////////////////
// REDUCE VS CHAINED METHODS
/////////////////////////////////////////////////////////////////
var comedians = [
{ number: 1, actor: "Eddie Murphy", begin: 1980, end: 1984 },
{ number: 2, actor: "Michael Che", begin: 1984, end: 1986 },
{ number: 3, actor: "Damon Wayans", begin: 1985, end: 1986 },
{ number: 4, actor: "Tim Meadows", begin: 1991, end: 2000 },
{ number: 5, actor: "Tracy Morgan", begin: 1996, end: 2003 },
{ number: 6, actor: "Maya Rudolph", begin: 2000, end: 2007 },
{ number: 7, actor: "Kenan Thompson", begin: 2003, end: 2018 },
{ number: 8, actor: "Sterling K. Brown", begin: 2005, end: 2010 },
{ number: 9, actor: "Jay Pharoah", begin: 2010, end: 2016 },
{ number: 10, actor: "Leslie Jones", begin: 2014, end: 2018 },
];
/* Solve by chaining native methods of map and filter only */
var comediansFilteredAndMapped = (comedians) => {
// Your code here
};
var comedianNamesFilteredAndMapped = (comedians) => {
// Your code here
};
/* Solve by using native method of reduce only */
var comediansReduced1 = (comedians) => {
// Your code here
};
var comediansReduced2 = (comedians) => {
// Your code here
};
/////////////////////////////////////////////////////////////////
// UTILITY FUNCTIONS
////////////////////////////////////////////////////////////////
// IMPLEMENT ANY ADDITIONAL FUNCTIONS THAT YOU MAY NEED HERE