Skip to content

Commit

Permalink
andrewagain#77 comparing values fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
RudeBon committed Feb 23, 2021
1 parent 37b5607 commit 6ad0c0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/logic/operate.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export default function operate(numberOne, numberTwo, operation) {
return one.times(two).toString();
}
if (operation === "÷") {
if (two === "0") {
if (two.toString() === "0") {
alert("Divide by 0 error");
return "0";
} else {
} else {
return one.div(two).toString();
}
}
Expand Down

0 comments on commit 6ad0c0d

Please sign in to comment.