+ 1
pleaseeee help me in this issue......!
4 Answers
+ 1
According to newsapi's get started page / javascript ,
https://newsapi.org/docs/get-started, an object is returned from response.json().
And this is the reason you are seeing an error message, you are trying to iterate over an object.
To access the articles/array of the object, try data.articles.forEach(....)
0
Check the data type of data
Is it an array?
And also I will advice you create a function outside and pass data as a parameter instead of all in there
0
all i have done as you said but it shows now undefined data on user interface i try to solve this issue now.
0
Is the data response an array?