For the complete documentation index, see llms.txt. This page is also available as Markdown.

Session Plan

Session Materials

  • Demo – In-session live coding: plain-object motivation, Comment class, methods, flagged comments, then Errors / Web Components as “real world” context. index.js = worksheet; index-solution.js = reference. README.

Session Outline

Start VERY simple. Just a class that has few fields, no methods. Explain the diff from object to class. Explain instance etc. When they get that move on to class methods. Only teach extends if they really are on top of things otherwise just get them comfortable with classes :) if you can repeat a bit of promise, maybe when working with class that would be great.

  • Constructor

  • Instance

  • Methods (instance + static)

  • this

    • Refers to the instance of the class. Do go into too much detail and edge cases. Avoid mentioning bind, apply, etc unless you find it super important, the trainees will just forget it anyway!

  • Exercise

  • Extend (Only if time!)

    • Code inspiration (Error, ValidationError, Web Components sketch — matches demo Part 4)

Exercises

See the separate Exercises document.

Code inspiration

See the separate Code inspiration document.

Last updated