Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Tailwind, Vanilla

Udoh Julie 200

@Jey223

Desktop design screenshot for the Calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
3intermediate
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi guys, I would love to get reviews on the JS

Community feedback

T
Chamu 13,110

@ChamuMutezva

Posted

Hi UDOH Well done on your challenge. So far so good. Here are a few things that you can look at.

  • Consider setting a maximum number of digits that your calculator can take - you can not have a calculator that will take any input as long as you press a key.
  • try the following calculation 0.1 + 0.2
  • i can enter 9......67.... as input, set conditions that you cannot enter more than one decimal point and the same applies to the operators eg a scenatio like 98+-*
  • You did well on the structure of the html , well done

One thing with tailwind is the bloating of your html making it difficult to read your html (just an opinion)

Marked as helpful

1

Udoh Julie 200

@Jey223

Posted

@ChamuMutezva Thank you so much. This was really helpful.

0

@matusalab-dev

Posted

I didn't solve the challenge but from my perspective, refactor the toggle section by storing the color,background, and box-shadow because they're the same. in case you want to change the value of these properties, you have to go through each individual manually. they're not reusable. the second one is the array of buttons, you don't have to set the index explicitly you can use a loop. that's it. I hope this'll help you to refactor your code.

Marked as helpful

0

Udoh Julie 200

@Jey223

Posted

@mtslabrh97 Thank you so much. I'll do all these. I just found it difficult to access the colours outside the js since I am making use of tailwind.

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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