Skip to content

Suggestion: mention string interning #1940

Open
@icncsx

Description

@icncsx

If we want to be 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions