You are provided with two functions that need to handle different sets of arguments. Your goal is to modify these functions to achieve specific outputs based on the given requirements.
Modify the logMessages
function to handle a varying number of message inputs.
If the function receives more than three messages, print, [Person's Name] has sent a detailed message. Otherwise, print, [Person's Name] has sent a brief message.
The first argument passed to the function will always be the person's name, followed by the messages.
Modify the calculateAverage
function to accept an array of grades and log the average grade.
Ensure that you can pass the grades as separate arguments when calling the function.
We are not displaying the answer for this exercise.
We do this because we want you to challenge yourself
and
not give in to the temptation of looking at the solution.
We also don't want to leave you stuck, so if you feel
you have tried enough and are still unable to solve
this exercise, feel free to ask in our community.
Here is the link to join the community.