DEV Community

Amin Deraiya
Amin Deraiya

Posted on

Generate Random ChatRoom id for your next chat app

Function to generate ChatRoom Id:

function generate_chatRoom_id(id1, id2) {
  const sorted = [id1, id2].sort();
  const id = sorted[0] + sorted[1];
  return id;
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)