title: Sort array by firstname (alphabetically) in JavaScript
body: <p>I got an array (see below for one object in the array) that I need to sort by firstname using JavaScript.
  How can I do it?</p>
  <pre><code>var user = {
     bio: null,
     email:  &quot;user@domain.example&quot;,
     firstname: &quot;Anna&quot;,
     id: 318,
     lastAvatar: null,
     lastMessage: null,
     lastname: &quot;Nickson&quot;,
     nickname: &quot;anny&quot;
  };
  </code></pre>