Probem :- Inside the body of the callback function, you will need to return a template literal ```` which will contain the HTML content for the player cards.
Inside the template literals, add an empty div
with a class of "player-card"
.
const setPlayerCards = (arr = players) => {
playerCards.innerHTML += arr.map(
({ name, position, number, isCaptain, nickname }) => {
return `<div class = "player-card"></div>`;
}
);
};
Error:- The map
callback should return a template literal that contains an empty div
with a class of "player-card"
.
Please tell me why this error is occurring and how it can be solved?