How do I return the result of my calculator? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I return the result of my calculator?

https://code.sololearn.com/WWsM8jajToBX/?ref=app Every time a number or operator button is pressed, it is added to an array that acts as the memory. The array consists of strings of what the user types in ie [‘3’ , ‘+’ , ‘3’] Then when the user presses the equal button, I want the array form into one string using the join() method ie [‘3+3] Then I want to use the eval function to convert it into numbers and return an answer. 3+3 result: 6 But so far the only thing that returns is undefined. Please help.

20th Nov 2018, 4:08 AM
Thomas Czernek
Thomas Czernek - avatar
1 Answer
0
https://code.sololearn.com/WWsM8jajToBX/?ref=app Like this? I think I did what you said correctly, but I must be missing something because it still returns undefined. I’ll keep trying.
20th Nov 2018, 6:09 AM
Thomas Czernek
Thomas Czernek - avatar