var max =
      lobbyChats != null ? Math.max.apply(null, lobbyChats.map(x => x.id)) : 0;