Basic packaging types


Basic wrapper type is to wrap simple data type into complex data type.

var str = ‘andy’;


Only objects and complex data types have attributes and methods. Why is there a length attribute?

The process is as follows

Var temp = new string (‘andy ‘); / / wrapped as complex data type

STR = temp; / / give the value of the temporary variable to str

Temp = null; / / the temporary variable will be destroyed automatically