Skip to content

Commit

Permalink
Remove commented out section after confirming layout from last push
Browse files Browse the repository at this point in the history
  • Loading branch information
Heather Faerber committed May 6, 2024
1 parent df75fa4 commit ce4f021
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions lessons/module-2/array-prototype-methods-iterators.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,44 +245,6 @@ Be sure to include these in your notes, if you haven't already!
* The callback needs to return a **boolean**. You also cannot modify the element you're finding.
</section>

<!-- ## How to use `Array.filter(callbackFunction)`
<section class="call-to-action">
### Exercises
#### Example #1
Return a new array of *odd* numbers using the `filter` prototype method.
```js
const numbers = [1, 2, 3, 4, 5, 6, 7];
```
#### Example #2
Create a new array of *living* beatles using the `filter` method and store them in a `livingBeatles` variable.
```js
var beatles = [
{ name: 'John', living: false, instruments: ['guitar', 'bass', 'piano'] },
{ name: 'Paul', living: true, instruments: ['bass', 'guitar', 'piano'] },
{ name: 'George', living: false, instruments: ['guitar', 'sitar'] },
{ name: 'Ringo', living: true, instruments: ['drums', 'bongos'] },
];
```
#### Example #3
Create another array of beatles that play the guitar using the `filter` method and store them in a `guitarPlayingBeatles` variable. (*continue to use the data from above*)
</section>
<section class="answer">
### Important Takeaways
Be sure to include these in your notes, if you haven't already!
* Instead of returning the first match like `find`, `filter` will return a new **array** with all elements that match a condition.
* Useful for when you need to find a subset of elements in an array that matches a given condition.
* The callback needs to return a **boolean**. You also cannot modify the element you're finding.
</section> -->

## How to use `Array.reduce(callbackFunction)`

<section class="note">
Expand Down

0 comments on commit ce4f021

Please sign in to comment.