1function appendData(data) {
2 var mainContainer = document.getElementById("myData");
3 for (var i = 0; i < data.length; i++) {
4 var div = document.createElement("div");
5 div.innerHTML = 'Name: ' + data[i].firstName + ' ' + data[i].lastName;
6 mainContainer.appendChild(div);
7 }
8}