DEV Community

Discussion on: String Manipulation in JavaScript

akashsarkar profile image
Akash Sarkar

I learned something new about string immutability

swarnaliroy94 profile image
Swarnali Roy Author

Glad to know that. 😌

peerreynders profile image

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.