These are some examples of previously created materials by mentors that you can use yourself, or for inspiration.
The Mentors demo is an in-session demo for forEach, map, filter, and chained filter. Use index.js to implement the TODOs in class (FOREACH, MAP, FILTER, CHAINING). The README describes the files, how tasks are marked, and how the code works. index-solution.js has the full implementation for reference.
Write this code with traditional functions, no arrow functions yet!
- Try to write your own
forEach,mapandfilterwith the trainees. Shows very precisely how it works! forEach- Executes function for each item in the array, NO RETURN!- Mentors demo – do FOREACH TODO
- Code inspiration
- forEach homemade
- Exercises
map- Changes/transforms the items in the array- Mentors demo – do MAP TODO
- Code inspiration
- map homemade
- Exercises
filter- Changes the number of items in the array. Let the trainees investigatefilter- Mentors demo – do FILTER TODO
- Code inspiration
- filter homemade - Get help from trainees to write this
- Exercises
- Mentors demo – do CHAINING TODO (multiple filter conditions)
- Other example
See the separate Exercises document.
See the separate Code inspiration document.