Skip to content

Conversation

@Trig9ger
Copy link

все 4 лабораторных работы
изменена 3 лабораторная работа, в которой содержатся ссылки на 1, 2 и 4

изменена 3 лабораторная работа, в которой содержатся ссылки на 1, 2 и 4
Copy link

@mxwrlld mxwrlld left a comment

Choose a reason for hiding this comment

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

В целом, хорошо!

Comment on lines 28 to 49
let result;

switch (operation) {
case "addition":
result = num1 + num2;
break;
case "subtraction":
result = num1 - num2;
break;
case "multiplication":
result = num1 * num2;
break;
case "division":
// Проверка деления на ноль
if (num2 === 0) {
resultElement.textContent = "Ошибка: деление на ноль";
resultElement.className = "error";
return;
}
result = num1 / num2;
break;
}
Copy link

Choose a reason for hiding this comment

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

Лучше не совмещать бизнес - логику и изменение DOM - дерева. Разделите на функции. Как минимум, выделите функцию вычисления

Comment on lines 23 to 24
resultElement.textContent = "Ошибка: введите оба числа";
resultElement.className = "error";
Copy link

Choose a reason for hiding this comment

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

Используется в нескольких местах, также лучше вынести в отдельную функцию

Copy link

@mxwrlld mxwrlld left a comment

Choose a reason for hiding this comment

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

Напоминаю о необходимости внесения изменений!

@AvtoBBus
Copy link
Collaborator

Принято

@AvtoBBus AvtoBBus closed this Dec 20, 2025
@github-actions github-actions bot added Done and removed In progress labels Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants