This commit is contained in:
Awen Lelu
2026-01-08 16:25:20 +01:00
commit 1d33c58f02
2 changed files with 50 additions and 0 deletions

31
test.js Normal file
View File

@@ -0,0 +1,31 @@
const films = [
{
titre: "bloodpsort",
année: 1997
},
{
titre: "die hard",
année: 1999,
acteurCelebre: "Bruce willis"
}]
console.log(films)
console.log(films[0])
console.log(films.map(film => {
return {
...film,
titreAvecActeur: film.acteurCelebre ? `${film.titre} avec ${film.acteurCelebre}` : undefined
}
}))
const new_film = {
titre: "thunderman",
année: 2025
}
console.log([...films, new_film])
films.push(new_film)
console.log(films)