title: Map and Reduce a JSON Object with JavaScript
body: <p>Consider this object below:</p>
  
  <pre><code>    {
      "_items": [
          {
              "_id": "player_1",
              "score": {
                  "a": -4.74,
                  "b": 0.71,
                  "c": -4.04,
                  "d": 3.37,
                  "e": 0.22,
                  "f": 1.09,
                  "g": -2.17              
              }
          }
      ]
  }
  </code></pre>
  
  <p>I would to Map and Reduce and generate a new object containing only the score object :</p>
  
  <pre><code>{
      "a": -4.74,
      "b": 0.71,
      "c": -4.04,
      "d": 3.37,
      "e": 0.22,
      "f": 1.09,
      "g": -2.17
  }
  </code></pre>
  
  <p>I was thinking something like this might be moving in the right directions, but does not seem to do what I was expecting:</p>
  
  <pre><code>this.service.getscore()
    .map(res =&gt; res.json())
    .map(v =&gt; v._items[0].score)
    .subscribe(data =&gt; { this.sc = data });
  </code></pre>
  
  <p><code>console.log(this.sc);</code> will give me the same result as the first json.</p>
  
  <p>While I recognize that it is probably better and easier to do this on the server-side, it's not possible in my case. I am wondering if what I am trying to do can be done on the client side with JavaScript. Any suggestions?  </p>