Problem:- Below your existing paragraph elements, add another paragraph element with the text Nickname:
.
const setPlayerCards = (arr = players) => {
playerCards.innerHTML += arr.map(
({ name, position, number, isCaptain, nickname }) => {
return `
<div class = "player-card">
<h2>${isCaptain ? "(Captain)" : ""} ${name}</h2>
<p>Position: ${position}</p>
<p>Number: ${number}</p>
<p>Nickname: ${nickname}</p>
</div>`;
}
);
};
Error:- You should add a new paragraph element with the text Nickname:
Your new elementp
should come after theh2
element.
Why this error is occurring?
How it will be solved?