var r = nerdamer('imagpart(81+5*b*i)'); console.log(r.toString()); var t = nerdamer('imagpart(5+i)') console.log(t.toString());