-
Notifications
You must be signed in to change notification settings - Fork 101
6211 БатраковВА Лаб. 4 #368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
изменена 3 лабораторная работа, в которой содержатся ссылки на 1, 2 и 4
mxwrlld
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В целом, хорошо!
web/webproj4/script.js
Outdated
| 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; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше не совмещать бизнес - логику и изменение DOM - дерева. Разделите на функции. Как минимум, выделите функцию вычисления
web/webproj4/script.js
Outdated
| resultElement.textContent = "Ошибка: введите оба числа"; | ||
| resultElement.className = "error"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Используется в нескольких местах, также лучше вынести в отдельную функцию
mxwrlld
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Напоминаю о необходимости внесения изменений!
|
Принято |
все 4 лабораторных работы
изменена 3 лабораторная работа, в которой содержатся ссылки на 1, 2 и 4