Please review my JS calculator : )

Please review my JS calculator : )
0

#1

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

Here is the link: https://classact1.github.io/calculator/


#2

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.


#3

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.


#4

Looks really good. Maybe add a clear screen button?


#5

Nice work, I like the colors :slight_smile:


#6

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


#7

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


#8

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.


#9

Good work, Keep it up :+1: