diff --git a/oppgaver/uke7/ternary_operators/ternary.html b/oppgaver/uke7/ternary_operators/ternary.html index 5caf2e5..f30ed91 100644 --- a/oppgaver/uke7/ternary_operators/ternary.html +++ b/oppgaver/uke7/ternary_operators/ternary.html @@ -20,18 +20,28 @@ app.innerHTML = /*HTML*/ ` Input score: +
Your rating: ${scoreRating}
`; } - //control function getScoreRating(score) { - scoreRating = score > 70 ? score + " Excellent" : - score > 50 ? score + " Average" : - score + " Do better!"; + scoreRating = score > 90 ? score + " Excellent" : + score > 70 ? score + " Good" : + score > 50 ? score + " Average" : + score + " Do better!"; updateView(); } + function fizzBuzz() { + for (let i = 1; i < 101; i++) { + let fizzbuzzOrBuzzOrFizz = i % 15 === 0 ? 'fizzbuzz' : + i % 5 === 0 ? 'buzz' : + i % 3 === 0 ? 'fizz' : + i; + app.innerHTML += `
${fizzbuzzOrBuzzOrFizz}`; + } + }