Please review my JS calculator : )

Thought it would be much easier. Took me quite some time to complete. Tell my what you think : )

Here is the link:

Really nice job. Well designed and well coded.

I see one (very small) bug. If you attempt to add 0 to a number the screen turns off for a few clicks (for example, if i push 5 + 0 = I see a blank screen. Further number pushes still show a blank screen).

It looks like it’s caused by this line: if(previousValues[0] != number1){

When adding 0 the previousValue doesn’t change.

Regardless, very well done.

1 Like

Very nice design! The only other problem I found is dividing a very small number by a very large number. It appears to provide the result in scientific notation except with the end (“E-8”) cut off.

1 Like

Looks really good. Maybe add a clear screen button?

1 Like

Nice work, I like the colors :slight_smile:

1 Like

@cjsheets done!
thanks for feedback man and taking the time to look at the code : )

@mrthnmn didn’t notice this one. Now it works hopefully : ) Thanks for checking it out!

1 Like

Yes, that problem is fixed. Unfortunately I think there’s still something not quite right though. If I click 3+6+3 it shows 63. When I then click = the result is 66.

Good work, Keep it up :+1:

1 Like