Consider the following code (React JS code):
poll() {
var self = this;
var url = "//" + location.hostname + "/api/v1/eve/history/historical-data/" + this.state.itemId + '/' + this.state.regionId + '/40';
$.get(url, function(result) {
console.log(result.data, result.data.reverse());
self.setState({
error: null,
historicalData: result.data.reverse(),
isLoading: false
});
}).fail(function(response) {
self.setState({
error: 'Could not fetch average price data. Looks like something went wrong.',
});
});
}
Notice the console.log. Lets see an image:
Last I checked, reverse should have reversed the order of the array. Yet it doesn't.
Am I Using this wrong (official MDN Docs)? Why isn't reverse working?