I found this project quite challenging and I perhaps bit off more than I could chew with my “stretch goals”.
Specifically, I wanted to complete the project without using eval() and I also wanted to include:
a formula display with a customised scrollbar
comma separation of digits
a del/backspace button
a max digit limit (21)
a proper pos/neg button (as opposed to just using the subtract key)
keyboard controls
So, I’ve spent several weeks working on this project and much of the time was spent fixing various bugs and unintended behaviours. I’m sure there are still some I’ve missed!
I feel that some of my implementations may be somewhat clumsy/messy or sub-optimum. On the plus side, I found this project to be a good refresher for regex and using replace().
Anyway, I would appreciate any feedback and please let me know of any bugs. Thanks!
You’ve done an amazing work! I’ve checked your other project too, and they look really good. I am too stuck in calculator project. 4 days so far, I still fighting with the logic of parsing ans displying the formula. Anyway, too much frustration when things don’t work, but great pleasure when you see your work do what is supposed to do
Thanks for the kind words! Yeah, I definitely had some stressful moments coding the calculator, but it’s also very rewarding when you solve the issues and get things working properly.
Do you have a forum thread for your calculator? I could have a look if you’re completely stuck, although I’m not sure how much help I’d be as I’m far from being an expert!
Finally I finished mine It is passing all the tests and I am very satisfied despite the spaghetti code I have created . I advise you not to look inside for fear to have a heart attack Link to codepen
Ah, cool! I like the colour scheme and layout; plus you’ve added brackets, which is a nice bit of extra functionality. You might want to think about addressing the overflow in the display but otherwise great job!
Hi, Yes thank you for the advice about the overflow. I was aware about that, but completely forgot. Anyway I’ll stay away from coding a couple of days, then move on to the last project remaining I have for that module (JS librairies). Happy coding