var pgn = ' ... '; // let's assume this is a valid PGN string with 2 games.
var database = kokopu.pgnRead(pgn);
var gameIndex = 3; // invalid index since database contains only 2 games, at indexes 0 and 1 respectively
database.game(gameIndex); // WRONG BEHAVIOR -> returns the first game, instead of throwing an exception