Open oparkins opened 3 years ago
So if you look here, line 355 prevents the calculator display from overflowing; without this line I put in there, the calculator would allow me to keep clicking buttons and thus, overflow the display. That being said, I definitely should replace number 22
with a const variable that clarifies the purpose.
Thanks!
22 in
https://github.com/snack-boomz/TheOdinProject-JavaScript-GUICalculator-2/blob/cb79ac3f8a53f6944a4e06fd84d4864628eb9ea3/script.js#L355
is a magic number. Not sure where it is coming from or why. It is possible I missed the reasoning earlier. But it would be good to remove this magic number and replace with a constant. Then the constant could have the description for why
22
.Some references: