Skip to content

calculator script #447

Answered by avinashkranjan
divya-gh asked this question in Q&A
Discussion options

You must be logged in to vote

I had a question regarding the eval() function in the calculator script. I see that when the previous value is not 0, its value has been assigned with a new calculation result as seen below

My question is, Why are we trying to assign a value to the previous variable?

Challenges:
It was hard to understand what was expected. more documentation needed with expected results.

So That you can continue to do the calculation, In case of a complex calculation or you need to calculate something. So, It assigns the new answer to the variable for convenience else it would not be convenient if you need to remember last answer to calculate next expression.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by avinashkranjan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants