Skip to main content
added 7 characters in body
Source Link
Michael M.
  • 12.1k
  • 4
  • 25
  • 41

JavaScript (ES6) 29-5 = 24

Supports negative power.

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

ES5 :

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

JavaScript (ES6) 29

Supports negative power.

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

ES5 :

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

JavaScript (ES6) 29-5 = 24

Supports negative power.

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

ES5 :

function f(n){return (n&2?'-':'')+(n&1?'i':1)}
added 28 characters in body
Source Link
Michael M.
  • 12.1k
  • 4
  • 25
  • 41

JavaScript (ES6) 29

Supports negative power.

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

ES5 :

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

JavaScript (ES6) 29

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

ES5 :

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

JavaScript (ES6) 29

Supports negative power.

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

ES5 :

function f(n){return (n&2?'-':'')+(n&1?'i':1)}
added 86 characters in body
Source Link
Michael M.
  • 12.1k
  • 4
  • 25
  • 41

JavaScript 46(ES6) 29

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

ES5 :

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

JavaScript 46

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

JavaScript (ES6) 29

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

ES5 :

function f(n){return (n&2?'-':'')+(n&1?'i':1)}
Source Link
Michael M.
  • 12.1k
  • 4
  • 25
  • 41
Loading