Skip to content

Commit bffa8e9

Browse files
adicionei o método map na view.js
1 parent ceff22a commit bffa8e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/view.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ export const renderItems = (data) => {
22
const listaHobby = document.createElement('ul');
33
listaHobby.classList.add('container');
44

5-
data.forEach((item) => {
6-
listaHobby.innerHTML+=`
5+
const todosOsCards = data.map((item) => {
6+
return `
77
<li itemscope itemtype="http://https://schema.org/HobbyShop" class="containerLi">
88
<dl itemscope itemtype="#hobby">
99
<dt><img src="${item.imageUrl}" alt="imagem do card" itemprop="${item.name}" class="imagem_card" /></dt>
@@ -20,7 +20,7 @@ export const renderItems = (data) => {
2020
`;
2121
})
2222

23-
23+
listaHobby.innerHTML+=todosOsCards.join('');
2424
return listaHobby;
2525
};
2626

0 commit comments

Comments
 (0)