Skip to content

Conversation

@NikitaKir98
Copy link
Contributor

@NikitaKir98 NikitaKir98 commented Jun 3, 2025

@keksobot keksobot changed the title выполнил дз 9.2 Помощь друга Jun 3, 2025
js/filters.js Outdated
const onEffectsListClick = (evt) => {
const target = evt.target;

if (target.classList.contains('effects__preview')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Удобнее отсекать ненужные условия:

if (!target.classList.contains('effects__preview')) {
  return;
}

// вычисления, если содержит

Так будет меньше вложенного кода, а значит легче чтение

Copy link
Contributor Author

Choose a reason for hiding this comment

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

переделал, но не понял почему ! будет лучше

@ILokalin ILokalin merged commit a988177 into htmlacademy-javascript:master Jun 16, 2025
1 check passed
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