Design comparison
Solution retrospective
A fun app to develop. The most challenging part was utilizing an algorithm that evaluates a string that has a math expression. I ended up using the postfix algorithm to do exactly that. But first, I needed to convert the math expression from infix (5 + 5) to postfix (5 5 +). Postfix strings are perfect for evaluating math expressions using a stack data structure (my leetcode skills finally helped me for once....). And of course, the app is fully responsive and will look great on any device.
Community feedback
- @LucianoDLimaPosted 10 months ago
Well done on completing this challenge! A calculator is honestly so hard to make, it looks very simple but a lot of logic goes into that, so props to you
Feedback time:
- x / 0 = I n f i n i t y. Love that! It's always the first thing I check haha It would be nice if you erased everything after user types something with Infinity on screen. Right now if I do x / 0 and then I try to do more math, the infinity will still be on screen, which will result in undefined
- If I input a dot . when there is a 0, there is an error on console which won't let me do stuff like 0.4 + 0.3 unless I input 0 first. Since the zero is already on screen, it shouldn't be necessary to input it again
- Your page lacks an <h1> tag. You could make the calc an <h1>, or then add a screen reader only h1, that way assistive tools and SEO will work better in your website. A screen reader only h1 is basically invisible to users, so it won't appear anywhere, but it will still work for SEO and screen readers.
Marked as helpful1 - @mbd89Posted 9 months ago
Whats your leetcode profile ?
0@AbelMuroPosted 9 months ago@mbd89 https://leetcode.com/abelmuro/
I am spending less time on front end mentor and more time on leetcode. I feel like my development skills are ready for a junior position, but I won't get the job if I'm not good at leetcode.
0@mbd89Posted 9 months ago@AbelMuro you can definitely get the job without leetcode at all i believe right now. if you want to excel at leetcode look up math for computer science by Tom leighton at the mit opencourseware and introduction to algorithms by Erik demaine. also of course get the book introduction to algorithms by Cormen. with that you're ready for big tech interviews. but at your level right now i think you're ready to get a front end dev role
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord