Review
JavaScript provides object wrappers around primitive values, known as natives (String
, Number
, Boolean
, etc). These object wrappers give the values access to behaviors appropriate for each object subtype (String#trim()
and Array#concat(..)
).
If you have a simple scalar primitive value like "abc"
and you access its length
property or some String.prototype
method, JS automatically “boxes” the value (wraps it in its respective object wrapper) so that the property/method accesses can be fulfilled.