I currently have this incoming dataset:
[]
0:{"time": 1525355921817, "sym": "AAPL", "price": 169.16, "size": 98, "stop": false, …}
1:{"time": 1525355923216, "sym": "AAPL", "price": 170.15, "size": 6, "stop": false, …}
2:{"time": 1525355923216, "sym": "AAPL", "price": 170.06, "size": 57, "stop": false, …}
I require it to be formatted as follows:
0:{"time": 1525355921817, "sym": "AAPL", "price": 169.16, "index": 0}
1:{"time": 1525355923216, "sym": "AAPL", "price": 170.15, "index": 1}
2:{"time": 1525355923216, "sym": "AAPL", "price": 170.06, "index": 2}
In essence, removing the size and stop attributes while adding an index column. Additionally, I need to access it through this.data.price
to retrieve all the price values... Is this a feasible task? The data originates from an Angular service.
Could someone guide me on how to accomplish this? (Please keep in mind my limited familiarity with Angular and JavaScript)