This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4921688-programming-in-dart-fundamentals/lessons/30
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4921688-programming-in-dart-fundamentals/lessons/30
Quick note: in the video you say “Since List indices must be greater than 0…”. In reality it could be 0 or greater
Thanks @jshvarts! That’s absolutely correct. At 0:39, the statement should be “Since list indices must be greater than or equal to zero…”
Challenge 2: Instead of creating "var iteration = 0’, why not reinforce the use of indexOf (from challenge 1) with the iteration already taking place on “players”?
For example: print(‘$player had score ${scores[players.indexOf(player)]}’);