Skip to main content
4 of 8
added 130 characters in body
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#JavaScript (ES6), 33 28 bytes

n=>eval(1+("*"+n).repeat(n))

Add 7 bytes if we need to allow for negative integers.

n=>eval(1+("*"+n).repeat(n<0?-n:n))

And add 4 bytes if 0 should be output for input 0

n=>n?eval(1+("*"+n).repeat(n<0?-n:n)):n

##Try It

f=
n=>eval(1+("*"+n).repeat(n))
o.innerText=f(i.value=3)
i.oninput=_=>o.innerText=f(+i.value)
<input id=i type=number><pre id=o>


##33 byte solution n=>eval(Array(n).fill(n).join*)

Shaggy
  • 43.5k
  • 4
  • 36
  • 94