B4Coder

🏛️ College Admission (Form Logic) · Mission 4 of 6

🧾 Every Problem at Once

Students hate fixing one error, pressing Apply, and getting the next. Show every problem at once.

Your mission

  1. Make errors = [ ].
  2. Add "Name is required" if the name is empty, "Age must be 17 to 25" if the age is out of range, and "Marks must be 40% or more" if form.marks < 40.
  3. At the end: ok = length(errors) == 0. message = "All good!" if ok, otherwise "Please fix " + length(errors) + " problem(s)".

Getting the mission ready…