lib/node/Creator.js
// the base node can never be null.
the base node can never be null.
the base node can never be null .
term (base, exponent, coeff, explicitCoeff=false) {
    let term = base;
    if (exponent) {
      term = this.operator('^', [term, exponent]);
    }
    if (coeff && (explicitCoeff || parseFloat(coeff.value) !== 1)) {
      if (NodeType.isConstant(coeff) &&
          parseFloat(coeff.value) === -1 &&
          !explicitCoeff) {
        term = this.unaryMinus(term);
      }
      else {
        term = this.operator('*', [coeff, term], true);
      }
    }
    return term;
  }
term ( base , exponent , coeff , explicitCoeff = false ) { let term = base ; if ( exponent ) { term = this . operator ( '^' , [ term , exponent ] ) ; } if ( coeff && ( explicitCoeff || parseFloat ( coeff . value ) !== 1 ) ) { if ( NodeType . isConstant ( coeff ) && parseFloat ( coeff . value ) === - 1 && ! explicitCoeff ) { term = this . unaryMinus ( term ) ; } else { term = this . operator ( '*' , [ coeff , term ] , true ) ; } } return term ; }
the base node can never be null.
the base node can never be null .
// if you actually want -1 as the coefficient, set explicitCoeff to true