array to store messages

Our logic is wrapped in a .onload handler just to ensure that all the
markup and external JavaScript is fully loaded. In the next few lines, I
created an array, which will store all the messages, a socket object,
and few shortcuts to our DOM elements. Again, similar to the back-end, I
bind a function, which will react to the socket's activity. In my case,
this is an event, named message. When such an event occurs, we expect to
receive an object, data, with the property, message. Add that message to
our storage and update the content div. I've also included the logic for
sending the message. It’s quite simple, simply emitting a message with
the name, send.