You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// calling String function like this
// will try to create a primitive value of type string from the argument which
// is passed to the String function
String("chair") // the result is "chair"
// calling String like this
// will create new wrapper object
const chairWrapperObject = new String("chair");
// result:
// {0: "c", 1: "h", 2: "a", 3: "i", 4: "r", length: 4}
// autoboxing:
let chairString = "chair";
chairString.length = 4;
// chairString is autoboxed, which means
// that a temp wrapper object is created, then its length property is retrived
// after that the wrapper object is removed!
// the original chairString is not affected!
Autoboxing will NOT work for the folloing primitive types: