Appending String Lengths Challenge:

Given a string s on the characters a-z, A-Z, 0-9, append the length of s to itself, counting the additional character(s) in the length as part of the total length of s.

Input:

Just a string of arbitrary length (can be empty).

Output:

The same string, but with its length appended to the end.  The characters that represent the length should also be counted as part of the length.  In cases where there are multiple valid lengths to append, choose the smallest one possible (see test cases for examples).

Test Cases:

INPUT     -&gt; OUTPUT       // Comment
aaa       -&gt; aaa4
          -&gt; 1            // Empty string
aaaaaaaa  -&gt; aaaaaaaa9    // aaaaaaaa10 would also normally be valid, but violates using the smallest number rule mentioned above
aaaaaaaaa -&gt; aaaaaaaaa11
a1        -&gt; a13          // Input can contain numbers at the end of the string, you do not have to handle the fact that it looks like 13 rather than 3.

Longer test case(s):

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -&gt; aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa101
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -&gt; aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa102


Rules:

This is code-golf, so shortest code in bytes wins.  Standard loopholes are forbidden.  Submissions may be an entire program or a function, and you may either print the result to stdout or return it as a variable from a function.
JavaScript (ES6), 32 bytes

f=(s,n=0)=&gt;(s+n)[n]?f(s,n+1):s+n


How it works

f = (s, n = 0) =&gt;   // given a string 's' and starting with n = 0:
  (s + n)[n] ?      // if the Nth character of (s + n) exists:
    f(s, n + 1)     //   try again with n + 1
  :                 // else
    s + n           //   return s + n


Starting with N=0, we test the Nth character (0-based) of the string made of the concatenation of the original input string and the decimal representation of N. We increment N until this character doesn't exist anymore.

Example:

N =  0 : abcdefghi0
         ^
N =  1 : abcdefghi1
          ^
N =  2 : abcdefghi2
           ^
...
N =  8 : abcdefghi8
                 ^
N =  9 : abcdefghi9
                  ^
N = 10 : abcdefghi10
                   ^
N = 11 : abcdefghi11    -&gt; success
                    ^


Test cases



f=(s,n=0)=&gt;(s+n)[n]?f(s,n+1):s+n

console.log(f("aaa"));       // -&gt; aaa4
console.log(f(""));          // -&gt; 1
console.log(f("aaaaaaaa"));  // -&gt; aaaaaaaa9
console.log(f("aaaaaaaaa")); // -&gt; aaaaaaaaa11
console.log(f("a1"));        // -&gt; a13