fizzbuzz
This commit is contained in:
19
fizzbuzz/awen_lelu.html
Normal file
19
fizzbuzz/awen_lelu.html
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<html>
|
||||||
|
<script>
|
||||||
|
function ryangosling(n = 1, limit = 100) {
|
||||||
|
let result = ""
|
||||||
|
if (n % 3 === 0)
|
||||||
|
result = result + 'ryan'
|
||||||
|
if (n % 5 === 0)
|
||||||
|
result = result + 'gosling'
|
||||||
|
if (result)
|
||||||
|
console.log(result)
|
||||||
|
if (n <= limit)
|
||||||
|
ryangosling(n + 1, limit)
|
||||||
|
}
|
||||||
|
|
||||||
|
ryangosling()
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</html>
|
||||||
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