Skip to main content
Code Review

Return to Question

edited title
Link

Simple decimal calculator project

Post Reopened by Toby Speight, Sᴀᴍ Onᴇᴌᴀ
Make title describe what code does per site convention - see https://codereview.stackexchange.com/help/how-to-ask
Source Link

How can I reduce use if-else blocks here? Simple decimal calculator project

This code displays a simple decimal calculator with operations like add, subtract, multiply and divide. It also has a function to clear the result.

I try to reduce code repetition. I still think I used a lot of unnecessary if-elseif-else blocks here but tried my best. How can I reduce use if-elseof if-else blocks here?

here is codepen

screenshot of image

How can I reduce use if-else blocks here?

I try to reduce code repetition. I still think I used a lot of unnecessary if-else blocks here but tried my best. How can I reduce use if-else blocks here?

here is codepen

Simple decimal calculator project

This code displays a simple decimal calculator with operations like add, subtract, multiply and divide. It also has a function to clear the result.

I try to reduce code repetition. I still think I used a lot of unnecessary if-else blocks here but tried my best. How can I reduce use of if-else blocks here?

here is codepen

screenshot of image

deleted 195 characters in body
Source Link
Yasin
  • 21
  • 6

this is one of my first basic projects a calculator. The js code consisted of 374 lines of code in the first version of code. This is a new version. I try to reduce code repetition and now it consist of about 74 lines of code. I still think I used a lot of unnecessary if-else blocks here but tried my best. How can I will appreciate any feedback. Thank you.reduce use if-else blocks here?

this is one of my first basic projects a calculator. The js code consisted of 374 lines of code in the first version of code. This is a new version. I try to reduce code repetition and now it consist of about 74 lines of code. I still think I used a lot of unnecessary if-else blocks here but tried my best. I will appreciate any feedback. Thank you.

I try to reduce code repetition. I still think I used a lot of unnecessary if-else blocks here but tried my best. How can I reduce use if-else blocks here?

edited title
Link
Yasin
  • 21
  • 6
Loading
added 2030 characters in body
Source Link
Yasin
  • 21
  • 6
Loading
Post Closed as "Not suitable for this site" by slepic, pacmaninbw , Toby Speight
Summarise the purpose, not the concerns, in the title; remove CSS tags, as there's no CSS in the question
Link
Toby Speight
  • 88k
  • 14
  • 104
  • 325
Loading
added 13 characters in body
Source Link
Yasin
  • 21
  • 6
Loading
Source Link
Yasin
  • 21
  • 6
Loading
lang-html

AltStyle によって変換されたページ (->オリジナル) /