Im trying to do a function where I enter two different algebraic expressions and have a variable list to change them into numbers. However, it do not recognise the variables if they do not have an operator in between them like in this case:
let exp1 = 'x*y'
let exp2 = 'xy'
const variableList = {
x: 1.00
y: 1.50
}
mathjs.evaluate(exp1, variableList) // 1.5
mathjs.evaluate(exp2, variableList) // Error
return mathjs.equal(exp1, exp2)
Is there anyway to make it understand two variables in a row without an operator? It should also be possible to write units so for example I do not want "cups" to become "c* u * p * s" if possible.