Skip to content

Commit

Permalink
homework #5, js logic, fix(add an error message)
Browse files Browse the repository at this point in the history
  • Loading branch information
SashaDemi committed Nov 5, 2023
1 parent 2fd0fb6 commit 40da183
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions homeworks/sasha.demidenko_SashaDemi/5-logic/homework.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ function calculate(firstValue, secondValue, operation) {
return ('Enter a number');
} if (!Number.isFinite(secondNumber)) {
return ('Enter a number');
} if (firstNumber || secondNumber === 0) {
return ('Error');
}

let result;
Expand Down

0 comments on commit 40da183

Please sign in to comment.