code: function containsXY(positions, position) {
      return positions ? positions.some(function (p) {
          return hasSameXY(p, position);
      }) : false;
  }
docs: Checks if an array of positions contains a position.