Closed sant527 closed 2 years ago
What parser library are you using (so that I can reproduce the issue)?
Ijavascript produces the same output as Node.js cli; e.g.:
If you want to customise the output, see the documentation here and here. In your case, I suggest:
$ node
Welcome to Node.js v14.13.0.
Type ".help" for more information.
> var Parser = require('expr-eval').Parser;
undefined
> require('expr-eval').Expression.prototype[Symbol.for('nodejs.util.inspect.custom')] = function inspect(_depth, _opts) { return this.toString(); };
[Function: inspect]
> expr = Parser.parse("2 * x + 1");
((2 * x) + 1)
TODO: The documentation in http://n-riesco.github.io/ijavascript/doc/custom.ipynb.html#(MyClass.prototype.inspect) needs updating.
thank you very much for you time and answering the question.
I am trying to run this code on notebook https://github.com/silentmatt/expr-eval#substitutevariable-string-expression-expression--string--number
here
expr
prints asstring
where as on note book it prints the whole object