Browser and Web APIs

Chat Application: Dynamic Rendering

  1. Create a JavaScript chat with the following functions:
    • renderMessages takes an array of chat messages containing a username, text and timestamp, and renders them as an HTML list
    • fetchMessages creates an array of chat messages and uses it to call the renderMessages function
    Call the fetchMessages function at the beginning of the script.
  2. Remove the static list of chat messages from the chat HTML page and embed the JavaScript instead.