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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aymane Ismail
TP1 - Premiers pas en JS
Commits
71b9dd6c
Commit
71b9dd6c
authored
3 years ago
by
Aymane Ismail
Browse files
Options
Downloads
Patches
Plain Diff
Moitie G
parent
613c30c3
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
index.html
+1
-1
1 addition, 1 deletion
index.html
src/main.js
+17
-3
17 additions, 3 deletions
src/main.js
with
18 additions
and
4 deletions
index.html
+
1
−
1
View file @
71b9dd6c
...
...
@@ -14,7 +14,7 @@
<link
rel=
"stylesheet"
href=
"css/pizzaList.css"
>
<link
rel=
"stylesheet"
href=
"css/footer.css"
>
<script
src=
"
build
/main.js"
defer
></script>
<script
src=
"
src
/main.js"
defer
></script>
</head>
<body>
...
...
This diff is collapsed.
Click to expand it.
src/main.js
+
17
−
3
View file @
71b9dd6c
...
...
@@ -30,7 +30,7 @@ data.forEach(element => {
);
*/
cons
t
data
=
[
le
t
data
=
[
{
name
:
'
Regina
'
,
base
:
'
tomate
'
,
...
...
@@ -54,6 +54,22 @@ const data = [
}
];
// trie par nom
data
.
sort
((
a
,
b
)
=>
a
.
name
.
localeCompare
(
b
.
name
))
console
.
log
(
data
);
data
.
sort
((
a
,
b
)
=>
a
.
price_small
-
b
.
price_small
)
console
.
log
(
data
);
//data = data.filter(word => word.base == 'tomate' );
//data = data.filter(word => word.price_small < 6 );
data
=
data
.
filter
(
word
=>
word
.
name
==
2
);
let
html
=
""
;
data
.
forEach
(
element
=>
{
...
...
@@ -73,8 +89,6 @@ data.forEach(element => {
</a>
</article>`
;
console
.
log
(
html
);
html
+=
html2
;
}
...
...
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