Learn Modern JavaScript Methods By Building Football Team Cards - Step 34

Tell us what’s happening: Error is occured

Your code so far:

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

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

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

Challenge Information:

Learn Modern JavaScript Methods By Building Football Team Cards - Step 34

what error has occurred?

The challenge wants you To do exactly something like this:

`Other text: ${ theParam !== null ? theParam : "N/A"}`

is not allowing you to pass with something like this

  `Other text: ${ theParam ? theParam : "N/A" }`

I assume this is the issue the user has.
(More details about your problem would be useful)
Mind you this is not the solution but rather an example of ternary operation inside string templating

@denismitov7

please replace nickname ? in your code with nickname !== null ?

see if this detail is your issue.

I am 99% it is . Is quite annoying when the exercises give to people this example above.

 ${isCaptain ? "(Captain)" : ""}

These tests should be more permissive and allow multiple ways of resolving a task.

Hey @GeorgeCrisan, would you like to open an issue for that?

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

I went ahead and created an issue

1 Like
<p>Nickname: ${nickname !== null ? nickname : "N/A"}</p>