function clickCard(elem){
  elem.addEventListener('click', (e) => {
    if (!(e.target.classList.contains('open')) && (cardsCollection.length <= 1)){
      addCards(e.target);
      showCard(e.target);
      checkCards();
      updateMoves(moves);
      updateRating(moves);
      checkWin(matchedCards);
      if(moves === 1){
        startTimer();
      }
    }
});
}
/*
* Fire game functions. @ param {object} - card in cards[]
*Do it only when item wasn't cliked and @cardsCollection array has two items in it.
*
*/
Fire game functions. @ param {object} - card in cards[]
Do it only when item wasn't cliked and @cardsCollection array has two items in it.
Fire game functions . @ param { object } - card in cards [] Do it only when item wasn ' t cliked and @cardsCollection array has two items in it .
function clickCard(elem){
  elem.addEventListener('click', (e) => {
    if (!(e.target.classList.contains('open')) && (cardsCollection.length <= 1)){
      addCards(e.target);
      showCard(e.target);
      checkCards();
      updateMoves(moves);
      updateRating(moves);
      checkWin(matchedCards);
      if(moves === 1){
        startTimer();
      }
    }
});
}
function clickCard ( elem ) { elem . addEventListener ( 'click' , ( e ) => { if ( ! ( e . target . classList . contains ( 'open' ) ) && ( cardsCollection . length <= 1 ) ) { addCards ( e . target ) ; showCard ( e . target ) ; checkCards ( ) ; updateMoves ( moves ) ; updateRating ( moves ) ; checkWin ( matchedCards ) ; if ( moves === 1 ) { startTimer ( ) ; } } } ) ; }
Fire game functions.
Fire game functions .