Tell us what’s happening:
No puedo con este reto:
The next step would be to display the word (Captain)
next to the player if they are listed as a captain for the team.
Right next to the ${name}
expression, add a new embedded expression. Inside that expression, use a ternary operator to check if isCaptain
is true. If so, return (Captain)
otherwise return an empty string.
Your code so far
playerCards.innerHTML += arr.map(
({ name, position, number, isCaptain, nickname }) => {
`
<div class="player-card">
<h2>${name} ${ isCaptain ? '(Captain)' : ''} </h2>
</div>
`;
}
);
thanks for help
Reemplaza estas dos oraciones con tu código copiado.
Por favor, deja la línea ``` arriba y la línea ``` abajo,
porque permiten que tu código formatee correctamente en el post.
Your browser information:
El agente de usuario es: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Challenge Information:
Learn Modern JavaScript Methods by Building Football Team Cards - Step 29