scrimba
Create an RPG game - Rob Sutcliffe
join()
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

join()
by
AboutCommentsNotes
join()
by
Expand for more info
index.js
run
preview
console
import { emails } from "./data"

const emailAdressArray = emails.map(function(email){
return email.sender
});
console.log(emailAdressArray);

// use a join on our emailsHtmlArray to convert the array to a string
const emailsHtmlArray = emails.map(function(email){
const { sender, subject, date } = email;
return `
<div class="email">
<span>${sender}</span>
<span>${subject}</span>
<span>${date}</span>
</div>`;
});

document.getElementById("emails").innerHTML = emailsHtmlArray;
Console
[
"bill@microsoft.com"
,
"steve@apple.com"
,
"elon@tesla.com"
,
"elizabeth@theranos.com"
,
"larry@google.com"
,
"jeff@amazon.com"
,
"mark@facebook.com"
]
,
/index.html
-2:11