const pets = {...};
let wrap = document.querySelector('.wrap');
var pets_i = [];
for(let key in pets)
{
pets_i.push(key);
}
function createData(i)
{
if(i < pets_i.length)
{
return `<div class="item" data-name="${pets_i[i]}">${pets[pets_i[i]]}</div>` + createData(i + 1);
}
else
{
return "";
}
}
wrap.innerHTML = createData(0);