title: JavaScript functions, arrays and objects
body: <p>This is the JavaScript task that I want to perform</p>
  <p>====================================================</p>
  <ol>
  <li><p>First, declare a variable named myArray and assign it to an empty array.</p>
  </li>
  <li><p>Great! Now populate myArray with two strings.
  Put your full name in the first string, and your Skype handle in the second.</p>
  </li>
  <li><p>Next, declare a function named cutName. It should expect a parameter name.</p>
  </li>
  <li><p>cutName should return an array by breaking up the input string into
  individual words. For example &quot;Douglas Crockford&quot; should be returned as
  [&quot;Douglas&quot;, &quot;Crockford&quot;]</p>
  </li>
  <li><p>Declare a new variable named myInfo and assign it to an empty object
  literal.</p>
  </li>
  <li><p>Add the following three key-value pairs to myInfo:</p>
  </li>
  </ol>
  <ul>
  <li><p><strong>Key:</strong> <em>fullName</em>
  <strong>Value:</strong> The result of calling cutName on the name string within
  myArray.</p>
  </li>
  <li><p><strong>Key:</strong> <em>Skype:</em>
  <strong>Value:</strong> The Skype handle within myArray.</p>
  </li>
  <li><p><strong>Key:</strong> <em>GitHub</em>
  <strong>Value:</strong> If you have a GitHub handle, enter it here as a string. If not,
  set this to null instead.</p>
  </li>
  </ul>
  <h1>This is my code that I wrote which I gets only the number 4 procedure wrong</h1>
  <pre><code>var myArray = [];
  myArray = [&quot;Safianu Mohammed&quot;, &quot;mohammedsafianu&quot;];
  
  function cutName(name) {
      var fname = name;
      return fname;
  }
  
  name = (cutName(&quot;Safianu Mohammed&quot;));
  
  var myInfo = {};
  
  myInfo = {
      fullName: cutName(name),
      skype: myArray[1],
      github: &quot;null&quot;
  };
  </code></pre>