title: Replace a value in array after sort
body: <p>I sort my json data in the correct order, however I would like to replace the value of the position.</p>
  
  <p>My json data :</p>
  
  <pre>
  
      {
        "dev@be-activ-it.fr-Quiz-10": {
          "id": "dev@be-activ-it.fr-Quiz-10",
          "user_id": "dev@be-activ-it.fr",
          "myposition": 1,
          "points": 35
        },
        "fbl@be-activ-it.fr-Quiz-10": {
          "id": "fbl@be-activ-it.fr-Quiz-10",
          "user_id": "fbl@be-activ-it.fr",
          "myposition": 2,
          "points": 38
        },
        "ddd@be-activ-it.fr-Quiz-10": {
          "id": "ddd@be-activ-it.fr-Quiz-10",
          "user_id": "ddd@be-activ-it.fr",
          "myposition": 3,
          "points": 37
        }
      }
  
  </pre>
  
  <p>What I want :</p>
  
  <pre>
  
      {
        "fbl@be-activ-it.fr-Quiz-10": {
          "id": "fbl@be-activ-it.fr-Quiz-10",
          "user_id": "fbl@be-activ-it.fr",
          "myposition": 1,
          "points": 38
        },
        "ddd@be-activ-it.fr-Quiz-10": {
          "id": "ddd@be-activ-it.fr-Quiz-10",
          "user_id": "ddd@be-activ-it.fr",
          "myposition": 2,
          "points": 37
        },
        "dev@be-activ-it.fr-Quiz-10": {
          "id": "dev@be-activ-it.fr-Quiz-10",
          "user_id": "dev@be-activ-it.fr",
          "myposition": 3,
          "points": 35
        }
      }
  
  </pre>
  
  <p>My code :</p>
  
  <pre><code>let data = fs.readFileSync('course.json/rank.json', 'utf8');
      data = JSON.parse(data);
  
      const comparePoints = (a,b)=&gt;{
  
        let a_points = a["points"]
        let b_points = b["points"]
  
        return b_points-a_points
      }
  
      const sort = (data) =&gt; {
      let keys = Object.keys(data)
      let dataAsArray = keys.map(e=&gt;data[e])
      return dataAsArray.sort(comparePoints)
      }
  
      data = sort(data);
      console.log(data);
  </code></pre>
  
  <p>What I get:</p>
  
  <pre>
  
      [ { "id": "fbl@be-activ-it.fr-Quiz-10",
          "user_id": "fbl@be-activ-it.fr",
          "myposition": 2,
          "points": 38 },
        { "id": "ddd@be-activ-it.fr-Quiz-10",
          "user_id": "ddd@be-activ-it.fr",
          "myposition": 3,
          "points": 37 },
        { "id": "dev@be-activ-it.fr-Quiz-10",
          "user_id": "dev@be-activ-it.fr",
          "myposition": 1,
          "points": 35 } ]
  
  </pre>
  
  <p>I would like to swap the positions, can you help me? thx</p>