String
We know that JavaScript includes: number,string,boolean,null,undefined base Type and object type.
In my cognition, the method attribute should be an object that can have it.
var str= "Hello,world";
var s=str.substring (,);//ell
In terms of the return type above, str is of type string.
Look at the following how to declare a string using a global object.
So can I think: when I'm dealing with strings,
The JavaScript compiler first uses the STR string, using the new String (str), and becomes the object. It then invokes its approach, and then returns a string using the ToString () method.
Creation and destruction of temporary objects
From the example above I know that JavaScript creates temporary objects when processing strings and Number,boolean, and then destroys them.
var a = "Hello,world";
var c = new String (a); Created a String object.
C.len =;
Alert (typeof (c));//object;
alert (C.len);//
///////////////////////////////////////////////////////////////////////
a.len=;
The A.len compiler did not make an error because the temporary object created was destroyed after the operation was completed.
= = and = =
The above is a small set to introduce the JavaScript must Know (c) String. The method from where the relevant knowledge, hope to help everyone, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!