Design comparison
Solution retrospective
Hi fellow frontend developers,
This project was really fun to build. I liked that it wasn't just a calculator, you had to create a theme and also got to use local storage to save the user's theme selection.
- When using local storage should the users be presented with a screen telling them about the use of cookies?
- Is there a set of rules when creating a calculator? as in specific use cases to look out for?
Really appreciate any sort of feedback.. All the best to you all :)
Community feedback
- @Cats-n-coffeePosted about 2 years ago
Hi Carlos!
Nice solution! And great questions, I'll try to help answering them. I can't see you code on Github because the link seems broken. It seems that you might need to ask for consent to store data on the user's browser storage depending on what kind of data you are trying to store. Accepted answer on this post does a good summary https://law.stackexchange.com/questions/30739/do-the-gdpr-and-cookie-law-regulations-apply-to-localstorage. From what I remember it can also depend on the country we're talking about, the EU (as an example) being more strict than other countries.
I'm not sure about a set of rules for calculators, the only thing I would suggest is to look into how Javascript deals with certain operations. You might have encountered
NaN
, which shows up in certains cases (which you can find in the docs). This article does a good job at handling division by zero in Js https://www.educative.io/answers/how-does-javascript-handle-divide-by-zero. I tried doing 0/0, 1/0 and they both return.
in your calculator.One last thing, from looking at the Js source in the devtools, you could probably use
let
orconst
instead ofvar
, becausevar
is in the global scope which can lead to unexpected bugs.Hope this help!
Marked as helpful1@webshurikenPosted over 1 year agoHi @Cats-n-coffee,
I updated my github profile name and didn't update the links. I was away from this site for a while, but now Im back.
Thanks for taking the time to leave me feedback. Very interesting about asking for consent when storing data on the browser, didn't even cross my mind. I have noticed the division also, thank you. I will look to fix these bits.
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