Validation and Setters (JavaScript)
OOPA-levelLesson packSubscription
About this resource
Learn how to enforce rules on data using validation in constructors and setter methods in JavaScript, including the delegation pattern.
11 slides.
Lesson outline
- Validation — Where Does it Go?
- Validation in the Constructor
- Setter Methods in JavaScript
- The Delegation Pattern
- Thermostat in JavaScript: Full Demo
- UML: Thermostat
- Clamping or Rejection?
- Coding Practice: Thermostat + PasswordVault
- Lesson Summary
Unit bundleUnit 2B · Validation and Setters


