Challenge: Model Validations
Explore how to implement model validations in plain JavaScript by adding constraint checks and setters for properties in a movie app. Learn to validate data before saving, enforce unique and mandatory fields, and handle optional attributes while maintaining data integrity using Local Storage.
We'll cover the following...
We'll cover the following...
Problem statement
In this challenge, you have to make changes to the model code of your application to do the following:
-
Add a check function that validates the constraints defined for the property, and a setter method that invokes the check function and will be used for setting the value of the property.
-
Perform validation before any data is saved in the
addandupdatemethods.
You’ll be using the Movie ...