// 1. move the emails data into the data.js file
// 2. import the emails data back into this folder
const emails = [
{ sender:"bill@microsoft.com", subject:"You need to upgrade windows!", date:"Sep 5" },
{ sender:"steve@apple.com", subject:"Looking for a new phone?", date:"Sep 4" },
{ sender:"elon@tesla.com", subject:"Your tickets to Mars enclosed", date:"Sep 4" },
{ sender:"elizabeth@theranos.com", subject:"The results of your blood test", date:"Sep 2" },
{ sender:"larry@google.com", subject:"Regarding your search history", date:"Sep 1" },
{ sender:"jeff@amazon.com", subject:"Best new books this week", date:"Aug 23" },
{ sender:"mark@facebook.com", subject:"You've been tagged in 12 new photos", date:"Aug 21" }
];
let emailsHtml = '';
for(let email of emails) {
const { sender, subject, date } = email;
emailsHtml += `
<div class="email">
<span>${sender}</span>
<span>${subject}</span>
<span>${date}</span>
</div>`;
}
document.getElementById("emails").innerHTML = emailsHtml;