DEV Community

Discussion on: String Manipulation in JavaScript

Collapse
akashsarkar profile image
Akash Sarkar

I learned something new about string immutability

Collapse
swarnaliroy94 profile image
Swarnali Roy Author

Glad to know that. 😌

Collapse
peerreynders profile image
peerreynders

MDN: Primitive

All primitives are immutable, i.e., they cannot be altered. It is important not to confuse a primitive itself with a variable assigned a primitive value. The variable may be reassigned a new value, but the existing value can not be changed in the ways that objects, arrays, and functions can be altered.