To be simple, string is a character (string)...
And array is an array... you can put numbers, characters and other things!!!
Previous example:
The code copy is as follows:
var str = "liuzhanqi";
document.write(str["length"]);//equivalent str.l ength
var str = string.fromcharcode(72, 101, 108, 108, 111, 33);
document.write(str); //Each integer is encoded as unicode and concatenated into a string.
var str1 = "liu".localecompare("zhan");//Compare the current string with the parameter string according to the default comparison rules provided by this system
document.write(str1);//
var str2 = "liu".slice(1);//Extract a substring from the current string
document.writeln(str2);
document.writeln("se nki".split(' '));//Segment the string with a separator and return an array.
document.write('liu'.fontcolor('red'));
document.write('liu'.fixed());//Change the string as a monospaced word
document.write('liu'.strike());//Add a delete line on the string
document.write("senki".sub());//display as subscript
document.write("senki".sup());//display as superscript
charCodeAt(index) Returns the Unicode encoding of the characters at the string index. This value is an integer between 0 and 65535. If the index exceeds the range, it returns NaN.
concat(str2) Concatenate the string str2 to the current string to form a new string.
anchor(anchar_name) Create an anchor point
link(url) plus hyperlink
charAt(index) Returns a character at the specified position of index in the string
Have you understood the string String and Arry in JavaScript? If you have any questions, please leave me a message, and everyone will make progress together.