Search⌘ K

Challenge: Check the Names

Explore how to implement a callback function that validates a person's first and last names. Learn to handle errors when the first name is missing and correctly return names based on input presence, building your understanding of asynchronous callbacks in JavaScript.

Problem statement #

This exercise is to help you implement callback functions. In this challenge, assume you have a form that requires a person’s first name and last name. However, the first name is compulsory and cannot be skipped, whereas the last name is optional. ...