...
Solution Review: Check the Names
This lesson will explain the solution to the problem in the previous lesson.
const checkName = (firstName, lastName, callback) => { if (!firstName) return callback(new Error('No First Name Entered')) if(!lastName) return callback(firstName) const fullName = `${firstName}` + `${lastName}` return callback(fullName)}function callback(arg){ console.log(arg)}
We need to cater to three conditions:
If the first name is not given
If the last name is not given
If both ...