Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TP1 - Premiers pas en JS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eliott Collin
TP1 - Premiers pas en JS
Commits
81c80b25
Commit
81c80b25
authored
3 years ago
by
Eliott Collin
Browse files
Options
Downloads
Patches
Plain Diff
use Destructuring
parent
e91cb793
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.js
+11
-6
11 additions, 6 deletions
src/main.js
with
11 additions
and
6 deletions
src/main.js
+
11
−
6
View file @
81c80b25
...
@@ -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>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment