The simple point is that string is a character (string) ...
And the array is arrays ... Can put numbers ah, character Ah and a series of Dongdong!!!
Last Example:
Copy Code code as follows:
var str = "Liuzhanqi";
document.write (str["Length"]);//equivalence STR.L ength
var str = String.fromCharCode (72, 101, 108, 108, 111, 33);
document.write (str); The integers are encoded as Unicode and are concatenated into strings.
var str1 = "Liu". Localecompare ("Zhan")//Compare current string with parameter string by default comparison rule 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 ("));////split string with delimiter, return an array.
document.write (' Liu '. fontcolor (' red '));
document.write (' Liu '. fixed ());//Make the string appear as a width word
document.write (' Liu '. strike ());//Add a strikethrough to the string
document.write ("Senki". Sub ());//Display as subscript
document.write ("Senki". sup ());//Display as superscript
charCodeAt (index) returns the Unicode encoding of the character at the index of the string, which is an integer between 0~65535 and, if the index is out of range, returns Nan.
Concat (STR2) joins the string str2 the current string into a new string.
Anchor (ANCHAR_NAME) creates an anchor point
Link (URL) plus hyperlink
CharAt (index) returns a character in the string at the specified position in the index
Do the partners understand that string strings and arrays in JavaScript are Arry? Please leave a message for me and we will make progress together.