inside certain calculation I'm generating an math expression in javascript like
var myExpression = '';
if (!isNaN(myVal) && myVal> 0) {
myExpression += '(' + myVal+ ' * ' + someVal + ') +';
}
and based on certain user events I'm getting generated expression in console.log as you expect
(1 * 1) + (10 * 5) + ...
or
(10 * 5) + ...
How can I transform this math expression representation into real expression and to store it's result into variable?