changeFavoriteElementClass(element, isFavorite) {
    if (!isFavorite) {
      element.classList.remove('is-favorite');
      element.classList.add('is-not-favorite');
      const addFromFavsInfo = 'Add to favorite restaurants.';
      element.setAttribute('aria-label', addFromFavsInfo);
      element.setAttribute('title', addFromFavsInfo);
    } else {
      const removeFromFavsInfo = 'Remove from favorite restaurants.';
      element.classList.remove('is-not-favorite');
      element.classList.add('is-favorite');
      element.setAttribute('aria-label', removeFromFavsInfo);
      element.setAttribute('title', removeFromFavsInfo);
    }
  }
/**
   * Handle styles and aria-label attribute for favorite button
   */
Handle styles and aria-label attribute for favorite button
Handle styles and aria - label attribute for favorite button
changeFavoriteElementClass(element, isFavorite) {
    if (!isFavorite) {
      element.classList.remove('is-favorite');
      element.classList.add('is-not-favorite');
      const addFromFavsInfo = 'Add to favorite restaurants.';
      element.setAttribute('aria-label', addFromFavsInfo);
      element.setAttribute('title', addFromFavsInfo);
    } else {
      const removeFromFavsInfo = 'Remove from favorite restaurants.';
      element.classList.remove('is-not-favorite');
      element.classList.add('is-favorite');
      element.setAttribute('aria-label', removeFromFavsInfo);
      element.setAttribute('title', removeFromFavsInfo);
    }
  }
changeFavoriteElementClass ( element , isFavorite ) { if ( ! isFavorite ) { element . classList . remove ( 'is-favorite' ) ; element . classList . add ( 'is-not-favorite' ) ; const addFromFavsInfo = 'Add to favorite restaurants.' ; element . setAttribute ( 'aria-label' , addFromFavsInfo ) ; element . setAttribute ( 'title' , addFromFavsInfo ) ; } else { const removeFromFavsInfo = 'Remove from favorite restaurants.' ; element . classList . remove ( 'is-not-favorite' ) ; element . classList . add ( 'is-favorite' ) ; element . setAttribute ( 'aria-label' , removeFromFavsInfo ) ; element . setAttribute ( 'title' , removeFromFavsInfo ) ; } }
Handle styles and aria-label attribute for favorite button
Handle styles and aria - label attribute for favorite button