Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: mention string interning #1940

Open
icncsx opened this issue Jun 1, 2020 · 1 comment
Open

Suggestion: mention string interning #1940

icncsx opened this issue Jun 1, 2020 · 1 comment

Comments

@icncsx
Copy link

@icncsx icncsx commented Jun 1, 2020

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.

@iliakan
Copy link
Member

@iliakan iliakan commented Jun 2, 2020

That topic - string internals - may become an article in the "Optimization" section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.