0

I am making a calculator that sends the numbers and math function in the text field to my server with body-parser but the function sent is a string and I can't calculate it. lets say my input is 3+5 and body-parser sends me a string "3+5" how can i make that string a number 3 and a number 5 to then add together or maybe even covert the whole function so it calculates right away?

I have tried to take out the + sign but then instead of 3+5 it's just 35

  • also [Safe evaluation of arithmetic expressions in Javascript](https://stackoverflow.com/questions/5066824/safe-evaluation-of-arithmetic-expressions-in-javascript) – pilchard Feb 12 '23 at 15:57

0 Answers0