Tell us what’s happening:
Please help to point me in the right direction keep getting this message think I’m hung on the word result. Or how to return it the right way.
Your filter() callback should implicitly return the result of checking if player.nickname is not null.
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
switch (e.target.value) {
case "nickname":
setPlayerCards(players.filter((player) => {
if (player.nickname) {
return (result !== null)
}
}));
}
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Challenge Information:
Learn Modern JavaScript Methods by Building Football Team Cards - Step 39