Would anyone be so kind as to help me write this code? Below is an assignment as a test to get into a coding boot camp that I really wanted to join. Can someone tell me how to write this code?
First, declare a variable named myArray and assign it to an empty array.
Now populate myArray with two strings:
Put your full name in the first string, and your favorite color in the second.
Next, declare a function named cutName. It should expect a parameter name.
cutName should return an array by breaking up the input string into individual words.
Example: cutName("Douglas Crockford") should return ["Douglas", "Crockford"]
Example: cutName("John B. Smith") should return ["John", "B.", "Smith"]
Declare a new variable named myInfo and assign it to an empty object literal.
Add the following three key-value pairs to myInfo:
Value: The result of calling cutName on the name string within myArray.
Value: The color within myArray.
Value:If you have a github handle, enter it here as a string. If not, set this to null instead.