Https://www.codecademy.com/paths/full-stack-engineer-career-path/tracks/fscp-redux/modules/connect-to-react-with-react-redux/projects/matching-memory-react-redux

please can someone explain me these line in the matched car project i’m not understand it well and thanks in advance :

 const [index1, index2] = flipState
        .filter(card => card.visible)
        .map(card => card.id);
      if (index2 !== undefined){
        const card1 = flipState[index1];
        const card2 = flipState[index2];