Shirt Numbers
JavaScript
20 pts
Shirt Numbers
In Yonas’s football team, the shirt number tells the position. Use one switch with grouped cases to set position:
- 1 →
"Goalkeeper" - 2, 3, 4, 5 →
"Defender" - 6, 7, 8 →
"Midfielder" - 9, 10, 11 →
"Forward" - anything else →
"Substitute"
Print exactly:
Number 7 plays as Midfielder
Checklist
- Set
positioncorrectly for the shirt number. - Use
switch (shirt)with grouped cases for 1–11. - Add
breakafter each group and adefault. - Print the sentence.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
