Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ We have already included Jasmine in the project you just forked, so let's see ho
Before start coding, we will explain the project structure we have provided you:

```
starter-code/
├── jasmine
│   ├── jasmine-2.8.0/
│   | └── ...
Expand Down Expand Up @@ -87,11 +86,13 @@ When coding with tests, is super important to read and understand the errors we

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.

## Find the maximum
You don't need to call the functions, the test will do that for you!

## Iteration 1: Find the maximum

Define a function `maxOfTwoNumbers` that takes two numbers as arguments and returns the largest.

## Finding Longest Word
## Iteration 2: Finding Longest Word

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.

Expand All @@ -109,12 +110,10 @@ var words = [
];
```

## Calculating a Sum
## Iteration 3: Calculating a Sum

Calculating a sum is as simple as iterating over an array and adding each of the elements together.

Semantically [reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce) is the best method to use for this, but you can use any loop we've discussed so far.

Create a `sumArray` function that takes an array of numbers as a parameter, and calculate the sum of all its numbers:

**Starter Code**
Expand All @@ -123,7 +122,7 @@ Create a `sumArray` function that takes an array of numbers as a parameter, and
var numbers = [6, 12, 1, 18, 13, 16, 2, 1, 8, 10];
```

## Calculate the Average
## Iteration 4: Calculate the Average

Calculating an average is an extremely common task. Let's practice it a bit.

Expand Down Expand Up @@ -163,7 +162,7 @@ var words = [
];
```

## Unique Arrays
## Iteration 5: Unique Arrays

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.

Expand All @@ -188,7 +187,7 @@ var words = [

```

## Finding Elements
## Iteration 6: Finding Elements

Let's create a simple array search.

Expand All @@ -208,7 +207,7 @@ var words = [
];
```

## Counting Repetion
## Iteration 7: Counting Repetion

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.

Expand All @@ -232,6 +231,8 @@ var words = [

## Bonus Quest

Don't focuse on the test for this exercise. It's just to help you beggin.

In the 20×20 grid below; What is the greatest product of four adjacent numbers in the same direction (up, down, left, right)?

Write a function `greatestProduct` to find the answer!
Expand Down
File renamed without changes.
File renamed without changes.