Update the function processResearchStudy
to process a nested research study object that includes details about participants, trials, and results. The function should extract the title of the study and the name of the primary investigator and log both values to the console.
For the first participant, it should retrieve their ID and all trial data while storing their results in an array called firstParticipantResults
. Log the participant's ID, trials, and results to the console.
For the second participant, the function should extract their ID and the result of their first trial while storing the remaining trial data in an object named remainingTrials
. Log the second participant's ID, the first trial result, and the remaining trial data to the console.
Additionally, the function should extract the overall mean and median response times from overallResults
, storing any remaining metrics in an object called remainingMetrics
. Log the mean response time, median response time, and the remaining metrics to the console.
Make sure that you maintain the specified order while logging details to the console.