Solution


Solution

  1. Given previous object
  2. Standalone function
  3. Object as input
  4. key/value list
  5. Insert into DOM

Solution

Create function that takes an object as an input and creates a list in the DOM out of the Object's key/value pairs.

function listObject(data) {
  const $ = document.querySelector.bind(document)
  let output = '<ul>'
  for (const key in data) {
    output+=`<li><a href="${data[key]}">${key}</a></li>`
  }
  output +='</ul>'
  $('#output').innerHTML = output
}