Skip to content

Latest commit

 

History

History
executable file
·
1 lines (1 loc) · 556 Bytes

File metadata and controls

executable file
·
1 lines (1 loc) · 556 Bytes

Every primitive type has a object wrapper type, just like how the data type number has the object wrapper Number(). As mentioned previously, primitive data types are passed by value while objects are passed by reference. In fact, since primitive data types can't hold properties, the JavaScript engine converts the primitive data type into its corresponding object type before calling the property of the string. You can use new String() to explicitly create string object or use String(stringObject) to create explicitly create a primitive string.