title: How to return object of first and last names
body: <p>The result is returning {firstname: 'Mike,Henry,Pete', lastname: 'Port,Split,Micky'}
  I want result to return
  {
  firstName: Mike,
  lastName: Port
  },
  {
  firstName: Henry,
  lastName: Split
  },
  {
  firstName: Pete,
  lastName: Micky
  }</p>
  <pre><code>var data = &quot;Mike Port, Henry Split, Pete Micky&quot;;
  var firstName = [];
  var lastName = [];
  var result = [];
  var newNames = data.replaceAll(&quot;, &quot;, &quot;,&quot;);
  var fullName = newNames.split(',');
  fullName.forEach(name =&gt; {
    let splitted = name.split(&quot; &quot;);
    firstName.push(splitted[0]);
    lastName.push(splitted[1]);
  });
  
  f_name_list = firstName.toString().split(&quot;, &quot;);
  l_name_list = lastName.toString().split(&quot;, &quot;);
  
  for (let i = 0; i &lt; f_name_list.length; i++) {
    result.push({ 
      firstname: f_name_list[i],
      lastname: l_name_list[i]
    });
  }
  
  console.log(result);
  </code></pre>