title: Sort array of objects by multiple properties of string type
body: <p>I am sorting my array in JavaScript based on names after then I am sorting it based in <code>joinDate</code> but somehow it is not checking for <code>joiningDate</code>.</p>
  <p>Unfortunately, I can't use an if-else condition - I only want to use ternary operators.</p>
  <p>My code is like this:</p>
  <pre><code>person.sort(((a, b) =&gt; (a.name &gt; b.name)  ? 1 : (a.joinDate &gt; b.joinDate) ? 1 : -1));
  </code></pre>
  <p>It is sorting the names but not sorting the <code>joinDate</code> property</p>
  <p>My list look like this:</p>
  <pre><code>{
  &quot;data&quot;: [
       {
           &quot;id&quot;: &quot;fdsf&quot;,
           &quot;name&quot;: &quot;Julie&quot;,
           &quot;joinDate&quot;: &quot;01/10/2019&quot;
  
        },
      ]
  }
  </code></pre>