function insertMessage(messageObj) {
	// Create a div object which will hold the message
	const message = document.createElement('div')

	// Set the attribute of the message div
	message.setAttribute('class', 'chat-message')
	console.log("name: " +messageObj.username + " content: " + messageObj.content)
	message.textContent = `${messageObj.username}: ${messageObj.content}`

	// Append the message to our chat div
	messages.appendChild(message)

	// Insert the message as the first message of our chat
	messages.insertBefore(message, messages.firstChild)
}
/**
 * Insert a message into the UI
 * @param {Message that will be displayed in the UI} messageObj
 */
Insert a message into the UI
@param {Message that will be displayed in the UI} messageObj
Insert a message into the UI @param { Message that will be displayed in the UI } messageObj
function insertMessage(messageObj) {
	const message = document.createElement('div')
	message.setAttribute('class', 'chat-message')
	console.log("name: " +messageObj.username + " content: " + messageObj.content)
	message.textContent = `${messageObj.username}: ${messageObj.content}`
	messages.appendChild(message)
	messages.insertBefore(message, messages.firstChild)
}
function insertMessage ( messageObj ) { const message = document . createElement ( 'div' ) message . setAttribute ( 'class' , 'chat-message' ) console . log ( "name: " + messageObj . username + " content: " + messageObj . content ) message . textContent = ` ${ messageObj . username } ${ messageObj . content } ` messages . appendChild ( message ) messages . insertBefore ( message , messages . firstChild ) }
Insert a message into the UI
 @param {Message that will be displayed in the UI} messageObj
Insert a message into the UI @param { Message that will be displayed in the UI } messageObj
// Create a div object which will hold the message // Set the attribute of the message div // Append the message to our chat div // Insert the message as the first message of our chat