Learn Modern JavaScript Methods by Building Football Team Cards - Step 27

Tell us what’s happening:

Can anyone help me, I have been stuck on this for a few hours now. I made a mistake and submitted step 26 to the forum instead of 27

Your code so far

<!-- file: index.html -->

/* file: script.js */
// User Editable Region


  playerCards.innerHTML += arr.map(
    ({ name, position, number, isCaptain, nickname }) => {
     return `
        <div class="player-card">
          <h2>${isCaptain ? "(Captain)" : "" }${name}</h2>
        </div>
      `;
    }
  );


// User Editable Region
/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

Learn Modern JavaScript Methods by Building Football Team Cards - Step 27

Hi. There is no space after the empty string. Also check your spacing inside the backticks. Think how it will look and where you need a space.

Hey, there was already a space after the empty string. I also added a space after "(Captain) " and still no luck :see_no_evil:

playerCards.innerHTML += arr.map(
    ({ name, position, number, isCaptain, nickname }) => {
     return `
        <div class="player-card">
          <h2>${isCaptain ? "(Captain) " : "" }${name}</h2>
        </div>
      `;
    }
  );

the tests are really string (this is going to change soon

You need to remove the space after the empty string, and you need to add a space before the name

Still not working after I added a space before the name ""} ${name}

playerCards.innerHTML += arr.map(
    ({ name, position, number, isCaptain, nickname }) => {
     return `
        <div class="player-card">
          <h2>${isCaptain ? "(Captain) " : ""} ${name} </h2>
        </div>
      `;
    }
  );

now you have added one space after the name, as I said the tests are really strict

1 Like

Hi

return `
        <div class="player-card">
          <h2>${isCaptain ? "(Captain) " : ""} ${name} </h2>
        </div>
      `;```

Put Captain back to how it was.  The space after ${name} didn't cause an issue for me.

Hi there!

Remove that space after (captain), before the quote mark.

Also remove that space

Thank you sir, it’s finally passed! Next time i’ll look closely for spaces

Thank you sir, it’s finally passed! Next time i’ll look closely for spaces

Please do not call me sir

I apologise, forgive me for my ignorance.