first of all, apologize horribly worded title; have been trying think of 1 past 20 minutes not know succinct way describe problem having. if has better suggestion, please let me know or edit title if able to. background : in order learn nodejs, creating chat server. when user clicks createroombtn , event created containing name of room user created, , sent socket.js module in app.js , app.js appends room array of rooms (these rooms displayed list in browser), , creates broadcast event users including active user. problem : let's there empty list, , user adds new room, titled "nodejs", display room on screen, , fine , dandy. now, if add room, socket.io, example, browser renders following result: socket.io, nodejs, nodejs . if add "javascript", result javascript, socket.io, nodejs, socket.io, node.js . basically, browser renders list on , on again, , each time list shrinks one. not have slightest idea of why happening. weird thing if press refresh, ...