using the for of loop in pure javascript to populate data into HTML code example

Example: using the for of loop in pure javascript to populate data into HTML

// blah blah blah ajax call blah blah blah fetch, blah blah blah something else that brings me data

//data comes back as something to iter through
var data = [{
  email: 'something'
}, {
  email: 'something2'
}, {
  email: 'blah'
}, {
  email: 'blah2'
}, {
  email: 'blah blah'
}, {
  email: ':o blah'
}]


data.forEach(item => {
  var div = document.createElement('div')
  div.innerHTML = `
some fancy box//// ${item.email} \\\\\\some more facy box
` document.body.appendChild(div); })

Tags:

Misc Example