Javascript challange | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Javascript challange

1- First, declare a variable named myArray and assign it to an empty array. 2- Now populate myArray with two strings: Put your full name in the first string, and your favorite color in the second. 3-Next, declare a function named cutName. It should expect a parameter name. 4- 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"] 5- Declare a new variable named myInfo and assign it to an empty object literal. 6-Add the following three key-value pairs to myInfo: Key: fullName Value: The result of calling cutName on the name string within myArray. Key: favoriteColor Value: The color within myArray. Key: github Value:If you have a github handle, enter it here as a string. If not, set this to null instead.

19th Sep 2019, 8:07 AM
Khalid Rehman
Khalid Rehman - avatar
3 Answers
+ 1
And what is your qwestion?
19th Sep 2019, 11:00 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Write the program?
19th Sep 2019, 11:11 AM
Khalid Rehman
Khalid Rehman - avatar
0
Yes, you can write the program ussually here. Go to part 'coding' in this app
19th Sep 2019, 11:14 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar