Create a program in javascript
- First, declare a variable named myArray and assign it to anempty array.
- Now populate myArray with two strings:
Put your name in the first string, and “Sky” in the second. - Next, declare a function named cutName. It should expect aparameter name.
- cutName should return an array by breaking up the input stringinto individual words.
- Example: cutName(“Douglas Crockford”) shouldreturn [“Douglas”, “Crockford”]
- Example: cutName(“John B. Smith”) shouldreturn [“John”, “B.”, “Smith”]
- Declare a new variable named myInfo and assign it to an emptyobject literal.
- Add the following three key-value pairs to myInfo:
- Key: fullName
Value: The result of calling cutName on the namestring within myArray. - Key: bluesky
Value: The sky withinORPayPal Gateway not configured
ORPayPal Gateway not configured
- Key: fullName