The Team Object
JavaScript
10 pts
The Team Object
Add two methods to the object team:
win()adds 1 tothis.wins,summary()returns a text likeKeren Lions: 3 wins, built fromthis.nameandthis.wins.
Call win() three times, then print the result of summary(). Expected output:
Keren Lions: 3 wins
Checklist
- Add the methods
win()andsummary()usingthis. - Call
win()three times. summary()returns the text for the current number of wins.- Print the summary.
🔑 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.
