DEV Community

Discussion on: JavaScript’s Primitive Wrapper Objects (the hidden feature)

Collapse
 
abdelrahmanahmed profile image
Wahdan • Edited

Hi Rohtash, sorry for the confusing, I updated the example. Regarding your question, Objects, in general, are mutable, so primitive wrapper objects are considered mutable as well, but even if you tried to modify it, it will be useless and you will not notice it because javascript performs these steps when primitive wrapper are created:

Create an object of a corresponding type.
Call a specific method on the instance.
Delete the instance immediately.