fizzbuzz
This commit is contained in:
31
test.js
Normal file
31
test.js
Normal 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)
|
||||
Reference in New Issue
Block a user