a JavaScript function that handles the submission of the form and has access to the data that the user entered into the form.
we update the state with their responses as soon as they enter them.
typically maintain their own state and update it based on user input.
you can add a name attribute to each element and let the handler function choose what to do based on the value of event.target.name.
do the same exact thing if does in just one line of code that led to shorter code yields us the same result.
if(x===y){
console.log(true);
} else {
console.log(false);
}
it will become
if(x===y) ? console.log(true) : console.log(false)