42
rated 0 times
[
47]
[
5]
/ answers: 1 / hits: 23820
/ 7 Years ago, sun, september 3, 2017, 12:00:00
I would like to count the length of my response JSON. Here's my code:
getMoviesFromApiAsync() {
return fetch('http://sampleurl.com/' + CommonDataManager.getInstance().getUserID())
.then((response) => response.json())
.then((responseJson) => {
this.setState({isLoading: false, listMessages: responseJson});
})
.catch((error) => {
console.error(error);
});
}
More From » javascript