title: Sorting duration and distance using javascript
body: <p>How do I sort distance and duration where lowest duration with the highest distance will be on top.</p>
  <p>Example:</p>
  <pre><code>let obj = [
      {
          duration: 50.1,
          distance: 300,
      },
      {
          duration: 60.9,
          distance: 300,
      },
      {
          duration: 30.08,
          distance: 300,
      },
      {
          duration: 90.0,
          distance: 310,
      },
  ];
  </code></pre>
  <p>Edit:</p>
  <p>Here will be the desired results:</p>
  <p>If distance is greater than other distance it will be on top even if the duration is highest.</p>
  <pre><code>let obj = [
        {
           duration: 90.00,
           distance: 310
           
        },
        {
          duration: 30.08,
          distance: 300
        },
        {
          duration: 50.10,
          distance: 300
        },
        {
          duration: 60.90,
          distance: 300
        }
      ]
  </code></pre>