Skip to main content

Instructor Notes

Want to make a change to this week but don't have the time? Click here

Want to report a bug in this week? Click here

Questions and Help

We highly recommend joining the relevant Slack Channel for this module. In this channel you can ask questions, get advice from previous teachers and discuss lesson content.

cyf-module-js2

For general Syllabus feedback and help you can post in cyf-syllabus

Flipped classroom recap/Q&A

The flipped classroom practice should have trainees

  • Revisit arrays of objects in greater detail
  • Practice TDD
    • Red->Green->Refactor
    • Given/When/Then
    • Write/run Jest tests
  • Bonus material (i.e. trainees should come back to this when they are ready/when they need it)
    • Using objects as maps (dictionaries, and other names)
    • for .. in loop

Some questions/prompts that may be useful

  • Why is it useful for arrays of objects to contain objects that "look the same"
  • What does it mean for 2 objects to "look the same"?
  • Ask trainees to write/understand a filter function against an array of objects
  • Ask trainees to write/understand a map function against an array of objects
  • Show a test from a previous week and ask what the test is doing (trainees have all the pieces of notation at this point
  • Why do we test? (probably still unclear at this point)
  • What is the red-green-refactor cycle
  • What is the structure we use to write tests? (Given/When/Then)
  • Can you translate some user requirements into Given/When/Then?

TDD Kata

Choose a very simple kata, level 7 at max. Go much slower than you feel is reasonable.

If you don't have a mentor who can demonstrate TDD style kata, ask in the #cyf-codewars channel for someone to dial in for 20 minutes. But don't worry - it doesn't have to be perfect! Just sharing these strategies with trainees is the goal here. Keep it simple, keep it short. Keep your mistakes in so trainees understand that mistakes are normal.

Presentations

Videos