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
@@ -13,23 +13,21 @@ In this exercise you will apply:
13
13
14
14
Manipulating arrays in code is a very common operation. Whether you're creating a total for a shopping cart, grabbing only the first names out of a list of people, or moving a piece on a chessboard, you're probably going to be modifying or manipulating an array in some way.
15
15
16
+
16
17
## Requirements
17
18
18
-
-[Fork this repo](https://guides.github.com/activities/forking/)
19
-
- Clone this repo into your `~/code/labs`
20
-
- Write your code in the js file provided in the `starter-code`
19
+
- Fork this repo
20
+
- Clone this repo
21
21
22
22
## Submission
23
23
24
-
Upon completion, run the following commands
24
+
Upon completion, run the following commands:
25
25
```
26
26
$ git add .
27
-
$ git commit -m 'done'
27
+
$ git commit -m "done"
28
28
$ git push origin master
29
29
```
30
-
Navigate to your repo and create a Pull Request -from your master branch to the original repository master branch.
31
-
32
-
In the Pull request name, add your name and last names separated by a dash '-'
30
+
Create Pull Request so your TAs can check up your work.
33
31
34
32
## Testing Introduction
35
33
@@ -85,13 +83,14 @@ When coding with tests, is super important to read and understand the errors we
85
83
86
84
## Deliverables
87
85
88
-
All our work will be located in the `functions-and-arrays.js` file, so that will be enough. Anyway, you have to `push` the whole repo to Github.
86
+
Write your JavaScript in the provided `src/functions-and-arrays.js` file.
87
+
89
88
90
-
## Find the maximum
89
+
## Iteration #1: Find the maximum
91
90
92
91
Define a function `maxOfTwoNumbers` that takes two numbers as arguments and returns the largest.
93
92
94
-
## Finding Longest Word
93
+
## Iteration #2: Finding Longest Word
95
94
96
95
Write a function `findLongestWord` that takes an array of words and returns the longest one. If there are 2 with the same length, it should return the first occurrence.
97
96
@@ -109,7 +108,7 @@ var words = [
109
108
];
110
109
```
111
110
112
-
## Calculating a Sum
111
+
## Iteration #3: Calculating a Sum
113
112
114
113
Calculating a sum is as simple as iterating over an array and adding each of the elements together.
115
114
@@ -123,7 +122,7 @@ Create a `sumArray` function that takes an array of numbers as a parameter, and
Calculating an average is an extremely common task. Let's practice it a bit.
129
128
@@ -163,7 +162,7 @@ var words = [
163
162
];
164
163
```
165
164
166
-
## Unique Arrays
165
+
## Iteration #5: Unique Arrays
167
166
168
167
Take the following array, remove the duplicates, and return a new array. You're more than likely going to want to check out the [`indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) function.
169
168
@@ -188,7 +187,7 @@ var words = [
188
187
189
188
```
190
189
191
-
## Finding Elements
190
+
## Iteration #6: Finding Elements
192
191
193
192
Let's create a simple array search.
194
193
@@ -208,7 +207,7 @@ var words = [
208
207
];
209
208
```
210
209
211
-
## Counting Repetion
210
+
## Iteration #7: Counting Repetition
212
211
213
212
Write a function `howManyTimes` that will take in an array of words as one argument, and a word to search for as the other. The function will return the number of times that word appears in the array.
214
213
@@ -230,7 +229,7 @@ var words = [
230
229
];
231
230
```
232
231
233
-
## Bonus Quest
232
+
## Iteration #8: Bonus
234
233
235
234
In the 20×20 grid below; What is the greatest product of four adjacent numbers in the same direction (up, down, left, right)?
0 commit comments