This is the JavaScript task that I want to perform
====================================================
First, declare a variable named myArray and assign it to an empty array.
Great! Now populate myArray with two strings. Put your full name in the first string, and your Skype handle 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. For example "Douglas Crockford" should be returned as ["Douglas", "Crockford"]
Declare a new variable named myInfo and assign it to an empty object literal.
Add the following three key-value pairs to myInfo:
Key: fullName Value: The result of calling cutName on the name string within myArray.
Key: Skype: Value: The Skype handle within myArray.
Key: GitHub Value: If you have a GitHub handle, enter it here as a string. If not, set this to null instead.
This is my code that I wrote which I gets only the number 4 procedure wrong
var myArray = [];
myArray = ["Safianu Mohammed", "mohammedsafianu"];
function cutName(name) {
var fname = name;
return fname;
}
name = (cutName("Safianu Mohammed"));
var myInfo = {};
myInfo = {
fullName: cutName(name),
skype: myArray[1],
github: "null"
};