first comit

This commit is contained in:
Johan
2025-12-15 14:53:51 +01:00
commit 9db552c24f
88 changed files with 797 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
const panier = [
{ nom: "Pommes", prix: 2.5 },
{ nom: "Lait", prix: 1.2 },
{ nom: "Pain", prix: 1.8 }
];
const total = panier.reduce((accumulateur, produit) => {
return accumulateur + produit.prix;
}, 0); // 0 est la valeur initiale de l'accumulateur
console.log("Prix total du panier:", total); // Affiche 5.5