VaR STR = "ABC" and STR = new string ("ABC"); Are there any differences? In fact, there is a difference,New String ("ABC") creates an object whose value is "ABC". What does the object Value mean by "ABC? It is something inside JavaScript. In short: Str = "ABC", the STR variable points to a constant string object, and STR = new string ("ABC,
STR points to an object type variable. The two objects are different.
The rule for the third equal sign "=" is as follows. If one variable points to the constant type and the other points to the object type, it must be different, for example, the assignment methods of the above two "ABC" methods do not want to be equal. if it is an object variable, it depends on whether it points to the same object. If it is a constant variable at the same time, it depends on whether the value is the same. of course, the values of constant objects of different types must be different.