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
playerCards.innerHTML += arr.map(
({ name, position, number, isCaptain, nickname }) => {
return `
<div class="player-card">
<h2>${isCaptain ? "(Captain) " : "" }${name}</h2>
</div>
`;
}
);
ILM
December 18, 2024, 3:53pm
4
PieroGentile:
"" }${name}
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>
`;
}
);
ILM
December 18, 2024, 4:53pm
6
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.
a1legalfreelance:
"(Captain) "
Hi there!
Remove that space after (captain)
, before the quote mark.
a1legalfreelance:
} </h2>
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
ILM
December 18, 2024, 8:34pm
11
PieroGentile:
sir
Please do not call me sir
I apologise, forgive me for my ignorance.