Tell us what’s happening:
Hello FreeCodeCamp,
I have a slight problem on this step. I feel like I’ve done everything right but I keep getting the error " If your ternary is falsy, it should display the string “N/A” ." But my falsy is indeed a string? I don’t understand why I keep getting this. I tried several solutions but nothing works.
Thanks for your help!
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>
// Also tried <p>Nickname: ${nickname !== null ? 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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Challenge Information:
Learn Modern JavaScript Methods by Building Football Team Cards - Step 33