Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Suggestion: mention string interning #1940
Comments
|
That topic - string internals - may become an article in the "Optimization" section. |
If we want to completely clear in the object copy lesson, we can include a snippet that mentions string interning, where since strings are immutable, only one instance is stored in memory and any future references to that same string can be referred to the singleton in existence. So yes, primitives are "copied as a whole value" in behavior, but it's a little bit more complicated than that if we get into implementation detail.
Is this too much? Thoughts? JavaScript.info seems to be a pretty thorough resource, so I can definitely see it including this kind of detail.