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

Tell us what’s happening:

I don’t know what’s wrong with this one. It keeps rejecting my code, even though it seems to be correct. I even checked the source code of this exercise and the validation function should accept my solution.

EDIT:
My code just got accepted in another browser (Edge). Maybe it’s some incompatibility between FCC website and Firefox? Weird, I have exactly the same extensions installed in Edge, if it matters.

assert.match(code, /\s*<h2\s*>\s*\$\{isCaptain(\s*===\s*true)?\s*\?\s*('|"|`)\(Captain\)\2\s*:\s*('|"|`)\3\}\s*\${\s*name\s*}\s*<\/h2>\s*/)

This is the validation function. I don’t really understand what’s going on here.

Your code so far

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

/* file: styles.css */

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

const setPlayerCards = (arr = players) => {

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


// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0

Challenge Information:

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

Do you have a closing curly } for setPlayerCards?

If you do, maybe you should reset this step and try again, or refresh the page, or do a hard refresh (on mac its command shift R).

The only visible difference between my code and yours is that mine does not have a empty line between these two lines:

          <h2>${isCaptain ? "(Captain)" : ""} ${name}</h2>
          
        </div>

I think it has something to do with Firefox and maybe some extension. I tried exactly the same code in Edge and I passed ¯\(ツ)

1 Like