A soccer game advanced
Belgium | Spain |
---|
Reconstruct the score history of the soccer game 'Belgium vs Spain'
-
Step 1: locate the
score
array, which is a listing of all goals made in the soccer game 'Belgium vs Spain', including the team, time and scorer -
Step 2: add a new row to the
tbody
for each goal.-
The first goal (from Belgium) will result in a
td
with value '1 (14m: E. Hazard)' for the Belgium column and atd
with value '0' for the Spain column -
The second goal (from Spain) will result in a
td
with value '1' for the Belgium column and atd
with value '1 (18m: F. Torres)' for the Spain column -
The third goal (from Spain) will result in a
td
with value '1' for the Belgium column and atd
with value '2 (32m: D. Olmo)' for the Spain column - ...
-
The first goal (from Belgium) will result in a
- Step 3: make sure that the scored goal is shown in bold!
// A soccer game (advanced)
const score = [
{ time: 14, team: 'Belgium', scorer: 'E. Hazard' },
{ time: 18, team: 'Spain', scorer: 'F. Torres' },
{ time: 32, team: 'Spain', scorer: 'D. Olmo' },
{ time: 44, team: 'Belgium', scorer: 'R. Lukaku' },
{ time: 56, team: 'Spain', scorer: 'F. Torres' },
{ time: 72, team: 'Belgium', scorer: 'R. Lukaku' },
{ time: 74, team: 'Belgium', scorer: 'D. Mertens' },
{ time: 89, team: 'Belgium', scorer: 'M. Batshuayi' },
];