Skip to content
Snippets Groups Projects
Commit 81c80b25 authored by Eliott Collin's avatar Eliott Collin
Browse files

use Destructuring

parent e91cb793
No related branches found
No related tags found
No related merge requests found
...@@ -24,15 +24,20 @@ const data = [ ...@@ -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"> return previous + `<article class="pizzaThumbnail">
<a href="${current.image}"> <a href="${image}">
<img src="${current.image}" alt="${current.name}"/> <img src="${image}" alt="${name}"/>
<section> <section>
<h4>${current.name}</h4> <h4>${name}</h4>
<ul> <ul>
<li>Prix petit format : ${current.price_small} €</li> <li>Prix petit format : ${price_small} €</li>
<li>Prix grand format : ${current.price_large} €</li> <li>Prix grand format : ${price_large} €</li>
</ul> </ul>
</section> </section>
</a> </a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment