var e = nerdamer('(x^2+1)/(x-1)'); var denominator = e.denominator().toString(); console.log(denominator); e = nerdamer('2/5'); denominator = e.denominator().toString(); console.log(denominator);