Closed hkiame closed 5 years ago
parseExpression
already converts the value
property of number expressions to number, so I don't think we need to do that again when evaluating. Can you provide an example of a call to run
that doesn't work as expected?
So sorry.. i missed that when i was writing the parseExpression. Thanks for the correction.
testing the run function it was concatenating instead of doing math.In the evaluate function where the expr.type is a value I had to add an if else statement to check if the value is a number then typecast it to a number.
if(/\d+/.test(expr.value)){ return Number(expr.value); }