title: How retrieve data from Object and store it to an array
body: <p>I write project in Angular2, where I want to get JSON and retrieve all <code>rooms</code> in an array.</p>
  <p>Here is my Service, which helps me to get right json-file</p>
  <pre><code>@Injectable()
  export class RoomlistService {
  
    constructor(private http: Http) { }
    getRooms(room) {
      console.log('get all rooms: ');
      return this.http.get('../../assets/rooms/' + room + '.json')
        .map(response =&gt; response.json());
    }
  }
  </code></pre>
  <p>And here is my Component, which uses this service and get data</p>
  <pre><code>  ngOnInit() {
      this.routeUrl.paramMap.subscribe( (param) =&gt; {
        this.buildingID = param.get('id');
        this.service.getRooms(this.buildingID).subscribe(data =&gt; {
          console.log(data);
        });
      });
    }
  </code></pre>
  <p>So, for now it works fine, and with <code>console.log</code> I get this <code>object</code></p>
  <p><a href="https://i.stack.imgur.com/WYii8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WYii8.png" alt="enter image description here" /></a></p>
  <p>What I would like to do is to get all <code>rName</code> and store it to an array.
  But everything I tried did not help me. Could you please help me to solve it?</p>