title: How to extract only first and last name by removing the middle name using javascript
body: <p>I am trying to display only First and Last name. Sometimes there will be a middle name comes. In that case i need remove the middle name and join first and last name.How is it possible using JavaScript.
  The name comes to a variable from database like</p>
  
  <pre><code>var displayname="abc pqr xyz"
  </code></pre>
  
  <p>i just need "abc xyz" to a variable .
  Thanks in advance</p>