##JavaScript (ES6), 3737 bytes
f=(n,k=1)=>k>n?n--?f(n):'':f(n,k+1)+k
###Demo
f=(n,k=1)=>k>n?n--?f(n):'':f(n,k+1)+k
console.log(f(6))
###Alternate method for n < 10, 34 bytes (non-competing)
f=(n,s='1')=>--n?s+f(n,++s[0]+s):s
In JavaScript, strings are immutable. Therefore, it's impossible to alter the content of the Nth character of a string s
by assigning a new value to s[N]
.
However, the expression ++s[N]
is valid and does evaluate as one would expect, even if the string remains unchanged. For instance:
++"1"[0] // equals 2
And by extension:
s = "21"
++s[0] + s // equals "321"
###Demo
f=(n,s='1')=>--n?s+f(n,++s[0]+s):s
console.log(f(6))