SHSubjectHub

Methods and toString (JavaScript)

OOPA-levelLesson packSubscription

About this resource

Learn how to add methods to a JavaScript class so objects can do things, and use toString to control how objects display.

10 slides.

Lesson outline

  1. Methods — What Objects Can Do
  2. Adding Methods: Live Demo
  3. UML — Adding the Methods Section
  4. The Problem with `console.log(rex)`
  5. Adding `toString()`: Live Demo
  6. All Three Languages: The Same Idea
  7. Coding Practice: The Counter Class
  8. Lesson Summary
Unit bundleUnit 1B · Methods and __str__
Part of: Unit 1B · Methods and __str__: the whole unitEvery resource in the unit in one zip.

More from Unit 1B · Methods and __str__