Skip to main content
Commonmark migration
Source Link

#JavaScript (ES6), 28 bytes

JavaScript (ES6), 28 bytes

n=>g=(x=2)=>++n%x?--x:g(++x)

##Test it

Test it

o.innerText=(f=

n=>g=(x=2)=>++n%x?--x:g(++x)

)(i.value=2521)();oninput=_=>o.innerText=f(+i.value)()
<input id=i><pre id=o>

#JavaScript (ES6), 28 bytes

n=>g=(x=2)=>++n%x?--x:g(++x)

##Test it

o.innerText=(f=

n=>g=(x=2)=>++n%x?--x:g(++x)

)(i.value=2521)();oninput=_=>o.innerText=f(+i.value)()
<input id=i><pre id=o>

JavaScript (ES6), 28 bytes

n=>g=(x=2)=>++n%x?--x:g(++x)

Test it

o.innerText=(f=

n=>g=(x=2)=>++n%x?--x:g(++x)

)(i.value=2521)();oninput=_=>o.innerText=f(+i.value)()
<input id=i><pre id=o>

added 6 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#JavaScript (ES6), 28 bytes

n=>g=(x=2)=>++n%x?--x:g(++x)

##Test it

o.innerText=(f=

n=>g=(x=2)=>++n%x?--x:g(++x)

)(i.value=2521)();oninput=_=>o.innerText=f(+i.value)()
<input id=i><pre id=o>

#JavaScript, 28 bytes

n=>g=(x=2)=>++n%x?--x:g(++x)

##Test it

o.innerText=(f=

n=>g=(x=2)=>++n%x?--x:g(++x)

)(i.value=2521)();oninput=_=>o.innerText=f(+i.value)()
<input id=i><pre id=o>

#JavaScript (ES6), 28 bytes

n=>g=(x=2)=>++n%x?--x:g(++x)

##Test it

o.innerText=(f=

n=>g=(x=2)=>++n%x?--x:g(++x)

)(i.value=2521)();oninput=_=>o.innerText=f(+i.value)()
<input id=i><pre id=o>

added 354 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#JavaScript, 28 bytes

n=>g=(x=2)=>++n%x?--x:g(++x)
n=>g=(x=2)=>++n%x?--x:g(++x)

##Test it

o.innerText=(f=

n=>g=(x=2)=>++n%x?--x:g(++x)

)(i.value=2521)();oninput=_=>o.innerText=f(+i.value)()
<input id=i><pre id=o>

#JavaScript, 28 bytes

n=>g=(x=2)=>++n%x?--x:g(++x)

#JavaScript, 28 bytes

n=>g=(x=2)=>++n%x?--x:g(++x)

##Test it

o.innerText=(f=

n=>g=(x=2)=>++n%x?--x:g(++x)

)(i.value=2521)();oninput=_=>o.innerText=f(+i.value)()
<input id=i><pre id=o>

Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading