Given a string:
var str1 = \"25*5+5*7\";
Without using eval or the constructor function in JavaScript, how would I be able to
eval
You can use the expression parser of math.js:
var str1= "25*5+5*7" document.write(str1 + ' = ' + math.eval(str1)); // output: "25*5+5*7 = 160"