Review my Javascript Calculator

Can you review it please.

Technologies I used are Pug, vanilla Javascript, Stylus

1 Like

Hi, looks super nice. I like the phone idea.

A few things though: unlimited dots, unlimited operators, overflowing text, (0.10.2 = 0), (.1.2 = NaN). And for design, you might want to use × (×) and ÷ (÷).

1 Like

A couple of other points;

  • Divided by zero says “Infinity.” A cannot-divide-by-zero message might be better.

  • The display doesn’t clear after clicking =.

  • Maybe consider something other than the “I-beam” pointer.

  • The cell-phone image is good and a nice idea.

  • Bruce

1 Like

The only other issue I noticed is you allow leading zeros (this doesn’t break the calc though :+1:

If I type minus 9, minus 6 I get

" err with sign - "

1 Like