Learn Modern JavaScript Methods by Building Football Team Cards - Step 39

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

arrow functions have a ‘implicit return’ shorthand which is written without any curly braces. Example:

const greaterThan = (a, b) => a > b;

console.log(greaterThan(3,4));

This script would log false.
The way I wrote the arrow function greaterThan is using an implicit return.

Note: to use an implicit return, your code must fit into one statement like mine. If you need more than one, then you cannot use an implicit return.

1 Like

mod edit: code removed

do you have any question here?

No thank you I got it sorry.

I removed the code to keep this thread spoiler free. thanks.