MCPcopy
hub / github.com/josdejong/mathjs / parseAndEval

Function parseAndEval

test/unit-tests/expression/parse.test.js:26–28  ·  view source on GitHub ↗

* Helper function to parse an expression and immediately evaluate its results * @param {String} expr * @param {Object} [scope] * @return {*} result

(expr, scope)

Source from the content-addressed store, hash-verified

24 * @return {*} result
25 */
26function parseAndEval (expr, scope) {
27 return parse(expr).evaluate(scope)
28}
29
30function parseAndStringifyWithParens (expr) {
31 return parse(expr).toString({ parenthesis: 'all' })

Callers 1

parse.test.jsFile · 0.70

Calls 1

evaluateMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…