Skip to content

Commit

Permalink
added destructure of array
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiMorozov88 committed Mar 20, 2024
1 parent 616b14d commit dd8ed73
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/src/js/cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ const cardSocialTemplateIcon = socialTemplate.content.querySelector('[data-templ
function addSocialLinks(container, object) {
container.innerHTML = '';
Object.entries(object).forEach((element) => {
cardSocialTemplateIcon.classList.add(`social__img-${element[0]}`);
cardSocialTemplateLink.href = `${element[1]}`;
const [socialName, link] = element;
cardSocialTemplateIcon.classList.add(`social__img-${socialName}`);
cardSocialTemplateLink.href = link;
const icon = socialTemplate.content.cloneNode(true);
container.append(icon);
cardSocialTemplateIcon.classList.remove(`social__img-${element[0]}`);
Expand Down

0 comments on commit dd8ed73

Please sign in to comment.