title: Filter JSON object to remove keys
body: <p>I have an Angular 2 app which gets some values from an API (which I can't control) using a promise.  The JSON returned is like this:</p>
  
  <pre><code>[{"Id":1053},{"Id":1054},{"Id":1103}]
  </code></pre>
  
  <p>However, my app only needs to consume an array of numbers i.e. what I need to consume is this:</p>
  
  <pre><code>[1053,1054,1103]
  </code></pre>
  
  <p>Here's the part of my app which gets the data from the API:</p>
  
  <pre><code>recordIds = [];
  
  ngOnInit() { 
      this._contentService.getAncestorNodes(currentNodeId).then(
          (data) =&gt; {
              data.map(function(record){
                  console.log('record.Id = ' + record.Id);
              });
          }
      );
  }
  </code></pre>
  
  <p>I've tried adding <code>this.recordIds.push(record.Id)</code> into the <code>data.map</code> function to try to build a new object of just the Ids, but I just get the following error:</p>
  
  <pre><code>Cannot read property 'recordIds' of undefined
  </code></pre>
  
  <p>Question is, how can I take the response from the API and parse it into the desired format?</p>
  
  <p>Many thanks.</p>