-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make new lesson for m2 iterator practice
- Loading branch information
1 parent
d03a728
commit 2f220ce
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
title: "Approaching Problems Many Ways" | ||
length: 60 | ||
tags: prototype methods | ||
--- | ||
|
||
## Learning Goals | ||
- Develop a deeper understanding of iterator methods | ||
- Reduce the risk of being too attached to one iterator method OR avoiding an iterator method | ||
- Compare and contrast iterator methods by using different iterators to achieve the same output | ||
|
||
## Activity | ||
|
||
### Set Up | ||
- Fork [this replit]() | ||
- We will be solving the same challenge three times today. Each time, you will be told with iterator method(s) you're allowed to use. | ||
|
||
### Round 1: `forEach` | ||
- Solve the prompt using a `forEach`. You may not use any other iterator methods. | ||
|
||
<section class="call-to-action"> | ||
### Round 1 Reflection | ||
|
||
- What are some pros and cons of using `forEach`? | ||
- Can you think of any prompt/scenario where a `forEach` would not work? | ||
</section> | ||
|
||
### Round 2: `filter` and `map` | ||
- Solve the prompt using a `filter` and `map`. You may not use any other iterator methods. | ||
|
||
<section class="call-to-action"> | ||
### Round 2 Reflection | ||
|
||
- What are some pros and cons of this approach? | ||
- Why couldn't we use only a `filter` or only a `map`? Why did we need to use both? | ||
</section> | ||
|
||
### Round 3: `reduce` | ||
- Solve the prompt using a `reduce`. You may not use any other iterator methods. | ||
|
||
<section class="call-to-action"> | ||
### Round 3 Reflection | ||
|
||
- What are some pros and cons of using `reduce`? | ||
- Can you think of any prompt/scenario where a `reduce` would not work? | ||
- Look at your code from the `forEach` and `reduce`. How do they compare? | ||
- Out of all 3 rounds, which approach did you prefer? Why? | ||
</section> | ||
|
||
## Looking Ahead | ||
While you are working on jsFUN, we recommend taking the time to solve the same problem multiple ways. This will reduce the likelihood that you become too attached or too afraid of an iterator method. It can also help to understand each method better if you are comparing them to each other. Remember that jsFUN is there to help you learn - finishing the problems as fast as you can is not the goal! |