Question: Using Javascript, Create a function called build person. It will not have any input parameters, but it will return an object that represents a person.

Using Javascript,

Create a function called build person. It will not have any input parameters, but it will return an object that represents a person.

Inside this function, use individual prompt statements to ask the user for the family members: full name, age, relationship (to you), favorite color, and favorite food. For example: Joe Smith, 79, grandpa, brown, prunes. Collect these bits of data in local variables inside the function. Example: var fullName = prompt("What is their full name?");

Once you have variables that contain each of these items, create a new object that contains these values and add them to the object. Then, return the object from the function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!