Closed dieegoalvareez closed 2 years ago
I want to pass key from a variable: if (expr){ const parser = new Parser(); let math_expr = parser.parse(expr); y = "y1" console.log(y) //y1 console.log(typeof y) //string console.log(math_expr.evaluate({ y : 3 })) }
what evaluate(token,expr,value) recives: console.log(value, expr) --> Output: { y: 3 }, Instruction { type: 'IVAR', value: 'y1' } and should receive { y1: 3 }, Instruction { type: 'IVAR', value: 'y1' }
regards,
I want to pass key from a variable: if (expr){ const parser = new Parser(); let math_expr = parser.parse(expr); y = "y1" console.log(y) //y1 console.log(typeof y) //string console.log(math_expr.evaluate({ y : 3 })) }
what evaluate(token,expr,value) recives: console.log(value, expr) --> Output: { y: 3 }, Instruction { type: 'IVAR', value: 'y1' } and should receive { y1: 3 }, Instruction { type: 'IVAR', value: 'y1' }
regards,