Skip to content

Commit

Permalink
Bonus mission LaunchCodeEducation#3 completed
Browse files Browse the repository at this point in the history
  • Loading branch information
BorntobeStarr committed Aug 17, 2021
1 parent e690f76 commit 3b92f0b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,23 @@ window.addEventListener("load", function () {
.then(function (astronauts){
let container = document.getElementById("container");
container.innerHTML+= `
<h2>Number of Astronaunts on Mission: ${astronauts.length}</h2>\
`
for (let i=0; i<astronauts.length; i++) {
container.innerHTML+= `
<div class="astronaut">
<div class="bio">
<h3>${astronauts[0].firstName} ${astronauts[0].lastName}</h3>
<h3>${astronauts[i].firstName} ${astronauts[i].lastName}</h3>
<ul>
<li>Hours in space: ${astronauts[0].hoursInSpace}</li>
<li>Active: ${astronauts[0].active}</li>
<li>Skills: ${astronauts[0].skills}</li>
<li>Hours in space: ${astronauts[i].hoursInSpace}</li>
<li>Active: ${astronauts[i].active}</li>
<li>Skills: ${astronauts[i].skills}</li>
</ul>
</div>
<img class="avatar" src="${astronauts[0].picture}">
<img class="avatar" src="${astronauts[i].picture}">
</div>
`
` }

})
})
Expand Down

0 comments on commit 3b92f0b

Please sign in to comment.