I need help these javascript exericses:

Input: A text string, using prompt.
Output: Either "Valid name" or "Invalid name", depending on whether the input names fit the required format, which is
Last name,first name, middle initial
where neither of the names have more than 15 characters.

Function : counter
Parameter: an array of numbers
Returns: the numbers of negative elements, zeros, and values greater than zero in the given array.

Note: you must use a switch statement in the function