Javascript - Challenge
Code Life
By Pierre Marsaa
Gym Leaderboard
The gym needs its leaderboard. Build it from the list of fighters, using array methods only.
Step 1: print one line per fighter, in the format "name: W wins / L losses".
Step 2: build winners, the names of the fighters with more wins than losses, and print "Winners: N" with how many there are.
Step 3: print each winner's name on its own line with "* " in front.
Step 4: print "Total wins: N" with the sum of every fighter's wins.
Expected output:
Loading editor...
↗️
Loading editor...
↶
↷
💡 Show Solution
Continue