const films = [ { name: "JAWS", director: "Spielberg", boxOffice: 127 } ,{ name: "SPychose", director: "Hitchcock", boxOffice: 23 } ,{ name: "ET", director: "Spielberg", boxOffice: 244 } ] //input director = "Saisir nom du director"; let nbEnt = 0; for (let index = 0; index < films.length; index++) { if (films[index].director == "Spielberg"/*director*/){ nbEnt += films[index].boxOffice; console.log(films[index].name); } } console.log(`nombre entré ${nbEnt}`);
COOL, bel effort
RépondreSupprimerpour tester ton code, j'ai mis
.col-3 {
flex: 0 0 26%;
max-width: 26%;
}
et OP : 2 lignes
Vite le challenge