-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathindex.js
60 lines (51 loc) · 1.85 KB
/
index.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
// using array methods complete each of the functions
function whereIsIt(word, array) {
// given an array and word return the index location of the given word
}
function evenNumbers(array) {
//given an array of numbers return an array of even numbers
}
function isItThere(value, array) {
//given a value and an array return a boolean if the value is present or not
}
function doubleIt(array) {
//given an array of numbers return an array with each value doubled (use 2 array methods)
}
function tripleIt(array) {
//given an array of numbers return an array with each value doubled (use 1 array methods)
}
function combineIt(array1, array2) {
//given 2 arrays combine them into one adding array 2 to array 1
}
function whatsThatMessage(word) {
// using 1 string method and 2 array methods find out what the secret word is ie an input of loocerauoy should return "youarecool".
}
function addingToEnd(value) {
const arr = [1,2,3] //do not change this line
// using one array method add the value to the end and return the array
}
function addingToBeginning(value) {
const arr = [1,2,3] //do not change this line
// using one array method add the value to the beginning and return the array
}
function removingFromEnd() {
const arr = [1,2,3] //do not change this line
// using one array method remove the value from the end and return the array
}
function removingToBeginning() {
const arr = [1,2,3] //do not change this line
// using one array method remove the value from the beginning and return the array
}
module.exports = {
whereIsIt: whereIsIt,
evenNumbers: evenNumbers,
isItThere: isItThere,
doubleIt: doubleIt,
combineIt: combineIt,
whatsThatMessage: whatsThatMessage,
tripleIt: tripleIt,
addingToEnd: addingToEnd,
addingToBeginning: addingToBeginning,
removingFromEnd: removingFromEnd,
removingToBeginning: removingToBeginning
};