# JavaScript (ES6) 29

Supports negative power.

<!-- language-all: lang-js -->

    f=n=>(n&2?'-':'')+(n&1?'i':1)

ES5 :

    function f(n){return (n&2?'-':'')+(n&1?'i':1)}