[FEEDBACK] My Javascript Calculator

[FEEDBACK] My Javascript Calculator
0

#1

Hello guys,
So, i “finished” my javascript calculator, it’s far from perfect and it’s quite broken really, but since i can’t progress further (i’ve been doing this project for two weeks, and i hate CodePen), i wanted to post it so i can get some feedback from you guys.

So, what do you think?


#2

Hello,

Just wanted to say well done, it’s coming along nicely. One thing I have spotted that wanted to mention, is be careful of global variables. They can cause hours of headaches (learnt from experience) if not assigned right and you can get unexpected behaviour from them.

I’m not sure how much experience you have with JavaScript, but if you want to further enhance your calculator, try looking at the Revealing Module Pattern. It’s main emphasis is to focus on keeping private function hidden and only exposing public functions that you specify.

https://addyosmani.com/resources/essentialjsdesignpatterns/book/#revealingmodulepatternjavascript

I hope that helps a bit, I found the revealing module pattern to be very useful and use it on a weekly basis in my job.

Thanks :slight_smile: