mathsteps
Version:
Step by step math solutions
19 lines (16 loc) • 376 B
JavaScript
const math = require('mathjs');
const stepThrough = require('./stepThrough');
function simplifyExpressionString(expressionString, debug=false) {
let exprNode;
try {
exprNode = math.parse(expressionString);
}
catch (err) {
return [];
}
if (exprNode) {
return stepThrough(exprNode, debug);
}
return [];
}
module.exports = simplifyExpressionString;