diff --git a/src/main.js b/src/main.js index 9bc016f41c0ea4f61f045e54567868cd65524f50..cab4ad9ff40ef4918879c52d1444e26fd6d5311a 100644 --- a/src/main.js +++ b/src/main.js @@ -24,15 +24,20 @@ const data = [ -const html = data.filter(pizza => pizza.name.split("").filter(value => value === "i").length === 2).reduce((previous, current) => { +const html = data.filter(({name}) => name.split("").filter(n => n === "i").length === 2).reduce((previous, { + image, + name, + price_large, + price_small +}) => { return previous + `<article class="pizzaThumbnail"> - <a href="${current.image}"> - <img src="${current.image}" alt="${current.name}"/> + <a href="${image}"> + <img src="${image}" alt="${name}"/> <section> - <h4>${current.name}</h4> + <h4>${name}</h4> <ul> - <li>Prix petit format : ${current.price_small} €</li> - <li>Prix grand format : ${current.price_large} €</li> + <li>Prix petit format : ${price_small} €</li> + <li>Prix grand format : ${price_large} €</li> </ul> </section> </a>