Topic: Elo Rating System Explained
I have part of a Javascript function that I want to rewrite. Currently it searches every property Matches to find the minimum, and makes Player2 always be the first member. Instead, I want Player1 to be the lowest result sorting by Matches, and Player2 to be random each time the code is run.

function elo(data) {
  // Find the two players with the fewest matches.
  let minMatches = Number.MAX_SAFE_INTEGER;
  let Player1 = null;
  let Player2 = null;
  for (let player of data) {
    if (player.Matches < minMatches) {
      minMatches = player.Matches;
      Player1 = player;
      Player2 = data.find(p => p !== Player1);
    }
  }
}

Topic: Elo Rating System Explained
Write a program to compute the Elo scores of a chess tournament.