Skip to content

done#155

Open
Dariadaria01 wants to merge 6 commits into
devmentor-pl:masterfrom
Dariadaria01:master
Open

done#155
Dariadaria01 wants to merge 6 commits into
devmentor-pl:masterfrom
Dariadaria01:master

Conversation

@Dariadaria01
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Owner

@devmentor-pl devmentor-pl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dario,

Bardzo dobrze sobie poradziłaś z zadaniami! 👍
Zostawiłem parę drobnych uwag w komentarzach.

Comment thread 01/app.js
);
const dataInfo = classElement.querySelectorAll('[data-info]');
console.log(dataInfo.length);
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread 02/app.js Outdated
const linksEl = document.querySelectorAll('[data-url]');
linksEl.forEach((link) => {
const url = link.dataset.url;
if (url && url !== 'null') {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To sprawdzenie nie jest potrzebne - szykujesz elementy tylko z odpowiednim atrybutem tj data-url więc jak on nie będzie istniał to element nie zostanie wyszukany.

Zamiast linii od 6 do 9, wystarczy sama linia nr 7

Comment thread 03/app.js
const parentElement = document.querySelector('.parent-for-button');
if (parentElement) {
parentElement.appendChild(button);
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread 04/app.js
const navElement = document.querySelector('nav');
const ulElement = document.createElement('ul');

menuItems.forEach((item) => {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jak widać zdecydowanie wygodniej i lepiej używać pętli :)
Czasami trzeba rozpisać sobie krok po kroku, aby użyć pętli - to nie jest źle, ale ostateczna wersja powinna być z wykorzystaniem pętli.

Comment thread 05/app.js

const articlesContainer = document.querySelector('.articles');

articlesContainer.insertBefore(newArticle, articlesContainer.firstChild);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Copy Markdown
Owner

@devmentor-pl devmentor-pl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread 02/app.js
} else {
link.setAttribute('href', '#');
}
link.setAttribute('href', url);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants