but it its throwing a typeError:cannot read property of undefined. What am I doing wrong?
for(i=0; i=data.items.length; i++){
//Asign fetched data to variables
bk_link = data.items[i].volumeInfo.canonicalVolumeLink;
bk_id =data.items[i].id;
bk_title=data.items[i].volumeInfo.title;
bk_subtitle=data.items[i].volumeInfo.subtitle;
bk_img =data.items[i].volumeInfo.imageLinks.smallThumbnail;
bk_descr =data.items[i].volumeInfo.description;
bk_pages =data.items[i].volumeInfo.pageCount;
can't you use a proper looping mechanism such as for (item of data.items) or data.items.forEach()?
Обсуждают сегодня