My attempt at the Calculator project (I would appreciate criticism on my code)

My attempt at the Calculator project (I would appreciate criticism on my code)
0

#1

My Calculator

I jumped into this one not really sure which way I wanted to take it. I looked at other peoples code for their calculator projects and honestly some of it just went over my head. I wanted to see how far I could get by structuring the JS on my own.

How efficient is my JS? I didn’t plan on using one giant if/else statement but the farther I went it just made the most sense to me. Basically for each click of a button, I would take the value of that button and push it into a single string and then use eval() on that string to get the answer. I would appreciate any tips to make it better!


#2

Nice! Only have a few suggestions. which is a good thing.
Would be a bit smoother to use buttons and the onclick="functionName(this) attribute.
Ill let you google it. :wink:

Otherwise it looks really good!
Keep it up! :+1: