var r = nerdamer('realpart(b*x+x*c*i)'); console.log(r.toString()); var t = nerdamer('realpart(5+i)') console.log(t.toString());