function onEachRail(rail, currentRail) {
    return currentRail === targetRailIndex
      ? [...rail, letter]
      : rail;
  }
Given a rail, adds a char to it if it matches a targetIndex.

@param {Rail} rail
@param {number} currentRail
@returns {Rail}