File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -7,18 +7,23 @@ window.addEventListener("load", function () {
7
7
. then ( function ( astronauts ) {
8
8
let container = document . getElementById ( "container" ) ;
9
9
container . innerHTML += `
10
+ <h2>Number of Astronaunts on Mission: ${ astronauts . length } </h2>\
11
+ `
12
+ for ( let i = 0 ; i < astronauts . length ; i ++ ) {
13
+ container . innerHTML += `
10
14
<div class="astronaut">
11
15
<div class="bio">
12
- <h3>${ astronauts [ 0 ] . firstName } ${ astronauts [ 0 ] . lastName } </h3>
16
+ <h3>${ astronauts [ i ] . firstName } ${ astronauts [ i ] . lastName } </h3>
13
17
<ul>
14
- <li>Hours in space: ${ astronauts [ 0 ] . hoursInSpace } </li>
15
- <li>Active: ${ astronauts [ 0 ] . active } </li>
16
- <li>Skills: ${ astronauts [ 0 ] . skills } </li>
18
+ <li>Hours in space: ${ astronauts [ i ] . hoursInSpace } </li>
19
+ <li>Active: ${ astronauts [ i ] . active } </li>
20
+ <li>Skills: ${ astronauts [ i ] . skills } </li>
17
21
</ul>
18
22
</div>
19
- <img class="avatar" src="${ astronauts [ 0 ] . picture } ">
23
+ <img class="avatar" src="${ astronauts [ i ] . picture } ">
20
24
</div>
21
- `
25
+
26
+ ` }
22
27
23
28
} )
24
29
} )
You can’t perform that action at this time.
0 commit comments