From the specification:
Returns a Number (a nonnegative integer less than 216) representing the code unit value of the character at position
pos
in the String resulting from converting this object to a String. If there is no character at that position, the result isNaN
.
So, 216 - 1 is the maximum value, which is 65535
.