Conversation
| it will make your code clearer. | ||
| 2. `reduce()` will automatically pass two arguments when it calls your reducer | ||
| function: the current element of the array and the current value of the | ||
| accumulator. Your function needs to accept those two values as parameters, |
There was a problem hiding this comment.
Maybe specify "Your reducer function..." or "Your callback function..." here
| ```js | ||
| artsShowcases["Visual"]; //=> [yishayGarbasz, wuTsang, mickaleneThomas] | ||
| ``` | ||
| **TAKE OUT LAB PORTION?** |
There was a problem hiding this comment.
Personally I would agree with this, but I generally think labs/lessons should be separated. Maybe we should discuss this in a more general sense?
There was a problem hiding this comment.
Agree it may be easier on students to review lesson content and have labs separately that way they can take a break and not get overwhelmed with reading and immediately doing a lab. This is also a good way of "chunking" content in the program to avoid cognitive overload on students
|
|
||
| To see what this might look like, let's count the number of coupons we have | ||
| lying around the house: | ||
| What if we wanted to calculate something else, say, the number of coupons we |
There was a problem hiding this comment.
Great built in check for understanding question!
| ```js | ||
| artsShowcases["Visual"]; //=> [yishayGarbasz, wuTsang, mickaleneThomas] | ||
| ``` | ||
| **TAKE OUT LAB PORTION?** |
There was a problem hiding this comment.
Agree it may be easier on students to review lesson content and have labs separately that way they can take a break and not get overwhelmed with reading and immediately doing a lab. This is also a good way of "chunking" content in the program to avoid cognitive overload on students
| - Learn how the `reduce()` method works | ||
| - Demonstrate using `reduce()` with a primitive return value | ||
| - Demonstrate using `reduce()` with an object as the return value | ||
| - Learn how the `Array.prototype.reduce()` method works |
There was a problem hiding this comment.
Recognize how the Array.prototype.reduce() method works.
linda-seiter
left a comment
There was a problem hiding this comment.
Suggestion: step through a debug session showing the calls to reduce() and couponCounter() for the manually implemented version (or show a table of function calls with parameter values).
Major updates to existing lesson