Skip to content

Conversation

@RangerOfNCR
Copy link

Добавил файлы 4й лабораторной работы.

Comment on lines 16 to 25
<main class="calculator-main">
<div class="calculator-card">
<div class="input-group">
<div class="input-wrapper">
<label for="num1"><i class="fas fa-hashtag"></i> Первое число</label>
<input type="number" id="num1" placeholder="Введите число" step="any">
</div>

<div class="operation-wrapper">
<label for="operation"><i class="fas fa-cogs"></i> Операция</label>
Copy link
Collaborator

Choose a reason for hiding this comment

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

На примере этого блока про БЭМ

calculator-main
|
|__ calculator-main__calculator-card
    |
    |__ calculator-card__input-group
        |
        |__ input-group__input-wrapper
        |
        |__ input-group__operation-wrapper
        |
        |__ input-group__input-wrapper

Comment on lines 2 to 8
const num1Input = document.getElementById('num1');
const num2Input = document.getElementById('num2');
const operationSelect = document.getElementById('operation');
const calculateBtn = document.getElementById('calculate');
const resetBtn = document.getElementById('reset');
const resultDisplay = document.getElementById('result');
const historyList = document.getElementById('history');
Copy link
Collaborator

Choose a reason for hiding this comment

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

А если какой-то элемент не был найден?

Copy link
Author

Choose a reason for hiding this comment

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

Не совсем понял вопрос. Можете, пожалуйста, поподробнее раскрыть?

Copy link
Collaborator

@AvtoBBus AvtoBBus Dec 17, 2025

Choose a reason for hiding this comment

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

Если getElementById вернет null, то дальше при попытке обратиться к его полям приложение упадет

@AvtoBBus AvtoBBus self-requested a review December 19, 2025 10:52
@AvtoBBus
Copy link
Collaborator

Ладно принято, но такая сложная проверка элементов излишняя в данной лабе

@AvtoBBus AvtoBBus closed this Dec 19, 2025
@github-actions github-actions bot added Done and removed In progress labels Dec 19, 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.

2 participants