So I'm making a fetch api with jquery. Everything is normal, but when I loop inside the loop it displays [object object], and when I log into the nested loop the data is normal. this my json
[
{
"Title": "Bla Bla",
"Author": "Feng Qi Yue",
"Artist": "Feng Qi Yue",
"User": {
"ID": 1,
"CreatedAt": "2021-02-23T11:16:10.722+07:00",
"UpdatedAt": "0001-01-01T00:00:00Z",
"Username": "soel30",
"Password": "blablbalbala",
"UserRefer": 1
},
"Genre": [
{
"ID": 1,
"CreatedAt": "2021-02-23T09:42:38.681+07:00",
"UpdatedAt": "2021-02-23T09:42:38.681+07:00",
"DeletedAt": null,
"Name": "Adventure",
"Slug": "adventure"
},
}
]
and this my jquery
$(document).ready(function () {
var url = "http://someurl"
fetch(url)
.then(res => res.json())
.then(data => {
$.each(data, function(i, k) {
$("tbody.list").append(`
<tr>
<td>`+ data[i].Title + `</td>
<td>`+ data[i].User.Username +`</td>
<td>` + data[i].Author + `</td>
<td>`+ data[i].Artist +`</td>
<td>`+ $.each(data[i].Genre, function(o, l) { data[i].Genre[o].Name })
+`</td> //the problem is here
<td>`+ data[i].Release +`</td>
</tr>
`)
})
})
}