code: function saveGame(index = undefined) {
    if (index !== undefined) {
      progress.push(index);
    }
    localStorage.setItem("progress_"+storyid, JSON.stringify(progress));
  }
docs: Autosave the game, adding a choice #index to the saved progress.