lib/solveEquation/stepThrough.js
// solve for the symbol. Returns an Status object.
solve for the symbol. Returns an Status object.
solve for the symbol . Returns an Status object .
function step(equation, symbolName) {
  const solveFunctions = [
    EquationOperations.ensureSymbolInLeftNode,
    EquationOperations.removeSymbolFromDenominator,
    EquationOperations.removeSymbolFromRightSide,
    EquationOperations.isolateSymbolOnLeftSide,
  ];
  for (let i = 0; i < solveFunctions.length; i++) {
    const equationStatus = solveFunctions[i](equation, symbolName);
    if (equationStatus.hasChanged()) {
      return equationStatus;
    }
  }
  return EquationStatus.noChange(equation);
}
function step ( equation , symbolName ) { const solveFunctions = [ EquationOperations . ensureSymbolInLeftNode , EquationOperations . removeSymbolFromDenominator , EquationOperations . removeSymbolFromRightSide , EquationOperations . isolateSymbolOnLeftSide , ] ; for ( let i = 0 ; i < solveFunctions . length ; i ++ ) { const equationStatus = solveFunctions [ i ] ( equation , symbolName ) ; if ( equationStatus . hasChanged ( ) ) { return equationStatus ; } } return EquationStatus . noChange ( equation ) ; }
solve for the symbol.
solve for the symbol .
// ensure the symbol is always on the left node // get rid of denominators that have the symbol // remove the symbol from the right side // isolate the symbol on the left side