Why I tried it in the chrome browser
'吉'.length === 1
高洛峰2017-05-19 10:27:44
> var a = "你好";
undefined
> console.log(a[1]);
好
undefined
>
length is the number of characters. It doesn’t matter what the storage is.
Strings are all operated on arrays, as shown in the above code.
So the length of the string you take is the length of the array.
Master Ruan, there are times when you feel faint, don’t worry about it~